Skip to content

nvme: Fix feature dispatch, flush status, log page and namespace ID validation - #323

Open
BeastLe9enD wants to merge 4 commits into
LekKit:stagingfrom
ProjectKML:nvme-fixes
Open

BeastLe9enD wants to merge 4 commits into
LekKit:stagingfrom
ProjectKML:nvme-fixes

Conversation

@BeastLe9enD

Copy link
Copy Markdown

Four independent fixes in the NVMe controller, one commit each:

  • Set Feature was dispatched as Get Feature: the opcode comparison
    used NVME_ADM_DELETE_IO_CQ instead of NVME_ADM_SET_FEATURE.
  • Flush always completed successfully even when rvvm_blk_sync()
    failed. Return a data transfer error in that case.
  • Get Log Page ignored the requested dword count and log page offset
    and always copied a full page. Validate both against the page size
    and copy only the requested range.
  • Identify and IO commands accepted any namespace ID. Return Invalid
    Namespace for IO and namespace-descriptor requests on unknown
    namespaces, a zeroed structure for Identify Namespace, and only list
    namespace 1 when the requested start lies below it.

The dispatch compared the opcode against Delete IO CQ, so every Set
Feature command was handled as Get Feature.
Flush always completed successfully even when synchronizing the backing
store failed.
Get Log Page copied a whole page regardless of the requested dword
count and ignored the log page offset. Reject requests that do not fit
into the page and copy only the requested range.
Identify and IO commands accepted any namespace ID. Return Invalid
Namespace for IO and namespace descriptor requests on unknown
namespaces, report an empty structure for unknown namespaces in
Identify Namespace, and only list namespace 1 when the requested
start lies below it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant