mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] nvme-tcp: two checks on the C2HData receive path
@ 2026-08-01  8:18 Yehyeong Lee
  2026-08-01  8:18 ` [PATCH v3 1/2] nvme-tcp: reject a read that transferred too few bytes Yehyeong Lee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yehyeong Lee @ 2026-08-01  8:18 UTC (permalink / raw)
  To: linux-nvme; +Cc: kbusch, axboe, hch, sagi, linux-kernel, Yehyeong Lee

Two problems on the nvme-tcp host receive path, both reachable by a
controller sending a C2HData PDU that does not match the command.

1/2: nothing compares the bytes actually received against the length the
command asked for, so a 4096-byte read answered with 512 bytes completes
as fully successful.

2/2: the C2HData gate reads blk_rq_payload_bytes() without first
checking blk_rq_nr_phys_segments(), the rule commit 25e5cb780e62
("nvme-tcp: fix possible crash in write_zeroes processing") established
for the send path.

v3 fixes two defects a reviewer found in v2: a CQE phase tag evaded the
success test in 1/2, and 2/2 had stopped rejecting a C2HData naming an
idle tag. Both are measured; the notes under --- have the detail.

Reproduced on v7.2-rc5 against a test target on loopback; no real hardware.

Link: https://lore.kernel.org/r/20260801060201.1879499-1-yhlee@isslab.korea.ac.kr

Yehyeong Lee (2):
  nvme-tcp: reject a read that transferred too few bytes
  nvme-tcp: do not accept C2HData based on blk_rq_payload_bytes() alone

 drivers/nvme/host/tcp.c | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-08-10 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-01  8:18 [PATCH v3 0/2] nvme-tcp: two checks on the C2HData receive path Yehyeong Lee
2026-08-01  8:18 ` [PATCH v3 1/2] nvme-tcp: reject a read that transferred too few bytes Yehyeong Lee
2026-08-01  8:18 ` [PATCH v3 2/2] nvme-tcp: do not accept C2HData based on blk_rq_payload_bytes() alone Yehyeong Lee
2026-08-10 22:58 ` [PATCH v3 0/2] nvme-tcp: two checks on the C2HData receive path Keith Busch

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

all inboxes | Powered by JetHome®