Skip to content

Commit 160f354

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme-tcp: fix UAF when detecting digest errors
We should also bail from the io_work loop when we set rd_enabled to true, so we don't attempt to read data from the socket when the TCP stream is already out-of-sync or corrupted. Fixes: 3f2304f ("nvme-tcp: add NVMe over TCP host driver") Reported-by: Daniel Wagner <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 6a02a61 commit 160f354

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ static void nvme_tcp_io_work(struct work_struct *w)
12291229
else if (unlikely(result < 0))
12301230
return;
12311231

1232-
if (!pending)
1232+
if (!pending || !queue->rd_enabled)
12331233
return;
12341234

12351235
} while (!time_after(jiffies, deadline)); /* quota is exhausted */

0 commit comments

Comments
 (0)