Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] nvme: target and host fixes from a drivers/nvme audit
@ 2026-12-02  3:47 Guixin Liu
  2026-12-02  3:47 ` [PATCH 1/4] nvme: mask the status before checking for Host Identifier Inconsistent Guixin Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Guixin Liu @ 2026-12-02  3:47 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, Hannes Reinecke
  Cc: linux-nvme

A static audit of drivers/nvme turned up these four independent bugs.
Each patch has its own reproducer and regression run, described below
the --- line.

  nvme: mask the status before checking for Host Identifier Inconsistent
    The EDS->legacy reservation report fallback never triggers when the
    controller sets DNR.

  nvmet: read CRTO from the capability register
    The CRTO property is extracted from CSTS and always reads zero.

  nvmet: snapshot the passthru command before completing the request
    nvme_passthru_end() reads req->cmd after the loop host request has
    been freed.

  nvmet-auth: select the configured DH group from the host's list
    DH group negotiation keeps a group the host did not offer and the
    fallback is dead logic.

Testing: QEMU/KVM guest, 7.3.0 kernel with KASAN, nvmet-tcp, nvme-loop
and nvmet passthru to a QEMU nvme backend. Each fix was reproduced on
the unpatched code, verified with the same recipe after patching, and
regression-tested with the test-only injections removed. The
passthru use-after-free is evidenced by free/read address tracking; the
test kernel's module-side KASAN does not splat on that access, as noted
in patch 3. The test-only injections live in the test environment only,
not in these patches.

Guixin Liu (4):
  nvme: mask the status before checking for Host Identifier Inconsistent
  nvmet: read CRTO from the capability register
  nvmet: snapshot the passthru command before completing the request
  nvmet-auth: select the configured DH group from the host's list

 drivers/nvme/host/pr.c                 |  2 +-
 drivers/nvme/target/fabrics-cmd-auth.c | 21 +++++++++++++--------
 drivers/nvme/target/fabrics-cmd.c      |  2 +-
 drivers/nvme/target/passthru.c         | 10 +++++++++-
 4 files changed, 24 insertions(+), 11 deletions(-)

-- 
2.43.7



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

end of thread, other threads:[~2026-12-02  5:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  3:47 [PATCH 0/4] nvme: target and host fixes from a drivers/nvme audit Guixin Liu
2026-12-02  3:47 ` [PATCH 1/4] nvme: mask the status before checking for Host Identifier Inconsistent Guixin Liu
2026-12-02  3:47 ` [PATCH 2/4] nvmet: read CRTO from the capability register Guixin Liu
2026-12-02  3:47 ` [PATCH 3/4] nvmet: snapshot the passthru command before completing the request Guixin Liu
2026-12-02  3:59   ` sashiko-bot
2026-12-02  5:45     ` Guixin Liu
2026-12-02  3:47 ` [PATCH 4/4] nvmet-auth: select the configured DH group from the host's list Guixin Liu
2026-12-02  4:01   ` sashiko-bot
2026-12-02  5:49     ` Guixin Liu

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