]> git.itanic.dy.fi Git - linux-stable/commit
nvme-tcp: fix UAF when detecting digest errors
authorSagi Grimberg <sagi@grimberg.me>
Mon, 5 Sep 2022 10:54:17 +0000 (13:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 10:04:55 +0000 (12:04 +0200)
commit19816a0214684f70b49b25075ff8c402fdd611d3
treeaddcfdd3d1500b2bb1cbf9f5631ffa9840ccc559
parenta4f0d34580b6e14dd3b5e4344350dbc3960286d4
nvme-tcp: fix UAF when detecting digest errors

[ Upstream commit 160f3549a907a50e51a8518678ba2dcf2541abea ]

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: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/tcp.c