Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] nvmet: fix stale log page data and a ZNS Identify error
@ 2026-11-06 15:00 shao.mingyin
  2026-11-06 15:00 ` [PATCH v2 1/2] nvmet: zero the entire Get Log Page transfer buffer shao.mingyin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: shao.mingyin @ 2026-11-06 15:00 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, linux-nvme; +Cc: linux-kernel, stable

This is v2 of the two-patch series.  Patch 1 now follows Christoph's
suggestion to zero the whole transfer buffer instead of only the unused
tail, and both commit messages are shorter.

Patch 1 zeroes the entire Get Log Page transfer buffer before filling
it, so a host that requests more bytes than the fixed structure no
longer receives stale kernel memory.  The Error log also clamps its
ring walk to the requested length instead of relying on a zeroed tail.
Patch 2 returns the namespace lookup error for a ZNS Identify on a
missing namespace instead of overwriting it with a successful copy.

The two patches are independent and can be applied in any order.  Both
carry Fixes: and Cc: stable.

Changes in v2:
 - 1/2: zero the whole transfer length first instead of only the unused
   tail, as suggested by Christoph.
 - 1/2: shorten the commit message.
 - 2/2: shorten the commit message; no code change.

Link: https://lore.kernel.org/all/20261105215753914RuQA4AVkFtXzpBkieEscY@zte.com.cn/

Testing: the uninitialized tail was made visible with page_poison=1
(CONFIG_PAGE_POISONING).  On the unpatched kernel a 4096-byte Supported
Log Pages request returned 0xaa in bytes 1024..4095 (10/10); with patch 1
the tail is zero (0/10).  The other log-page changes and the error-log
ring clamp are not runtime-tested.  Patch 2 is unchanged from v1, where
Identify CNS 05h/CSI 02h for a missing NSID returned Invalid Namespace
after the fix.

Shao Mingyin (2):
  nvmet: zero the entire Get Log Page transfer buffer
  nvmet: zns: return the namespace lookup error for Identify

 drivers/nvme/target/admin-cmd.c | 51 ++++++++++++++++++++++++++++++++---------
 drivers/nvme/target/pr.c        |  6 +++++
 drivers/nvme/target/zns.c       |  3 +--
 3 files changed, 47 insertions(+), 13 deletions(-)

---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-12 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 15:00 [PATCH v2 0/2] nvmet: fix stale log page data and a ZNS Identify error shao.mingyin
2026-11-06 15:00 ` [PATCH v2 1/2] nvmet: zero the entire Get Log Page transfer buffer shao.mingyin
2026-11-12 21:22   ` Christoph Hellwig
2026-11-06 15:00 ` [PATCH v2 2/2] nvmet: zns: return the namespace lookup error for Identify shao.mingyin
2026-11-12 21:22   ` Christoph Hellwig
2026-11-06 18:43 ` [PATCH v2 0/2] nvmet: fix stale log page data and a ZNS Identify error Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox