milos-linux/drivers/nvme/target
Sagi Grimberg dbbd07d0a7 nvmet-tcp: Fix potential UAF when ddgst mismatch
Shivam Kumar found via vulnerability testing:
When data digest is enabled on an NVMe/TCP connection and a digest
mismatch occurs on a non-final H2C_DATA PDU during an R2T-based
data transfer, the digest error handler in nvmet_tcp_try_recv_ddgst()
calls nvmet_req_uninit() — which performs percpu_ref_put() on the
submission queue — but does NOT mark the command as completed. It
does not set cqe->status, does not modify rbytes_done, and does not
clear any flag. When the subsequent fatal error triggers queue
teardown, nvmet_tcp_uninit_data_in_cmds() iterates all commands,
checks nvmet_tcp_need_data_in() for each one, and finds that the
already-uninited command still appears to need data (because
rbytes_done < transfer_len and cqe->status == 0). It therefore calls
nvmet_req_uninit() a second time on the same command — a double
percpu_ref_put against a single percpu_ref_get.

Reported-by: Shivam Kumar <kumar.shivam43666@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2026-05-11 08:07:40 -07:00
..
admin-cmd.c nvme fixes for Linux 7.1 2026-04-27 15:47:21 -06:00
auth.c nvmet-auth: Do not print DH-HMAC-CHAP secrets 2026-05-11 08:07:39 -07:00
configfs.c nvmet: introduce new mdts configuration entry 2026-04-08 08:13:46 -07:00
core.c nvme fixes for Linux 7.1 2026-04-27 15:47:21 -06:00
debugfs.c
debugfs.h
discovery.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fabrics-cmd-auth.c Revert "nvmet-tcp: Don't free SQ on authentication success" 2026-04-22 10:07:30 -07:00
fabrics-cmd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fc.c nvmet-fc: add WQ_PERCPU to alloc_workqueue users 2026-03-27 07:35:05 -07:00
fcloop.c block-7.0-20260305 2026-03-06 08:36:18 -08:00
io-cmd-bdev.c nvmet: report NPDGL and NPDAL 2026-03-27 07:35:05 -07:00
io-cmd-file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig nvmet-auth: Do not print DH-HMAC-CHAP secrets 2026-05-11 08:07:39 -07:00
loop.c nvme-loop: do not cancel I/O and admin tagset during ctrl reset/shutdown 2026-03-27 07:35:06 -07:00
Makefile
nvmet.h nvme fixes for Linux 7.1 2026-04-27 15:47:21 -06:00
passthru.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci-epf.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
pr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rdma.c block-7.0-20260312 2026-03-13 10:13:06 -07:00
tcp.c nvmet-tcp: Fix potential UAF when ddgst mismatch 2026-05-11 08:07:40 -07:00
trace.c
trace.h
zns.c nvmet: introduce new mdts configuration entry 2026-04-08 08:13:46 -07:00