Skip to content

nvmet: fix stale log page data and a ZNS Identify error - #11

Open
ghost wants to merge 2 commits into
for-next_basefrom
series/1203179=>for-next
Open

ghost wants to merge 2 commits into
for-next_basefrom
series/1203179=>for-next

Conversation

@ghost

@ghost ghost commented Nov 10, 2026

Copy link
Copy Markdown

Pull request for series with
subject: nvmet: fix stale log page data and a ZNS Identify error
version: 2
url: https://patchwork.kernel.org/series/1204276/

@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1204276/
version: 2

@ghost
ghost force-pushed the for-next_base branch from 8c33852 to 18eb5ad Compare November 10, 2026 10:19
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1204276/
version: 2

Shao Mingyin added 2 commits November 10, 2026 19:24
Several fixed-size Get Log Page handlers copy only the log structure
and leave the rest of the host buffer untouched.  The transport buffers
are not zeroed, so a host requesting more bytes than the structure
receives stale kernel memory.

Zero the entire transfer length before filling the buffer in the
Supported Log Pages, Commands Supported and Effects, Supported
Features, Endurance Group, Rotational Media Information and Reservation
handlers.  For the Error log, also clamp the ring walk to the requested
length and propagate copy failures instead of completing with success.

The Rotational Media Information handler now accepts a buffer larger
than its fixed structure.

Fixes: 11ad507 ("nvmet: add error log page cmd handler")
Fixes: 83acb24 ("nvmet: implement supported log pages")
Fixes: 0866bf0 ("nvmet: add commands supported and effects log page")
Fixes: e973c91 ("nvmet: implement supported features log")
Fixes: 266b652 ("nvmet: implement endurance groups")
Fixes: 5fd075c ("nvmet: implement rotational media information log")
Fixes: 5a47c20 ("nvmet: support reservation feature")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet_execute_identify_ns_zns() jumps to done when nvmet_req_find_ns()
fails, and that label overwrites status with a successful copy of the
zeroed identify data.  An Identify with CNS 05h and CSI 02h for a
missing NSID therefore completes with SUCCESS and zeroed data instead
of Invalid Namespace.

Return the lookup error instead.

Fixes: aaf2e04 ("nvmet: add ZBD over ZNS backend support")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
@ghost
ghost force-pushed the series/1203179=>for-next branch from db0512d to 1dca4a7 Compare November 10, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants