[PATCH 0/4] nvme: target and host fixes from a drivers/nvme audit
Guixin Liu
kanie at linux.alibaba.com
Tue Dec 1 19:47:03 PST 2026
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
More information about the Linux-nvme
mailing list