1
0
Fork 0
alistair23-linux/drivers/nvme/host
Sagi Grimberg c70f6e0ac9 nvme-tcp: fix possible data corruption with bio merges
commit ca1ff67d0f upstream.

When a bio merges, we can get a request that spans multiple
bios, and the overall request payload size is the sum of
all bios. When we calculate how much we need to send
from the existing bio (and bvec), we did not take into
account the iov_iter byte count cap.

Since multipage bvecs support, bvecs can split in the middle
which means that when we account for the last bvec send we
should also take the iov_iter byte count cap as it might be
lower than the last bvec size.

Reported-by: Hao Wang <pkuwangh@gmail.com>
Fixes: 3f2304f8c6 ("nvme-tcp: add NVMe over TCP host driver")
Tested-by: Hao Wang <pkuwangh@gmail.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:26:17 +01:00
..
Kconfig nvme-tcp: fix kconfig dependency warning when !CRYPTO 2020-10-01 13:18:19 +02:00
Makefile nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
core.c nvme: introduce nvme_sync_io_queues 2020-11-18 19:20:24 +01:00
fabrics.c nvme-fabrics: don't check state NVME_CTRL_NEW for request acceptance 2020-09-17 13:47:47 +02:00
fabrics.h nvme: Remove ADMIN_ONLY state 2019-10-14 23:21:44 +09:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: fail new connections to a deleted host or remote port 2020-10-07 08:01:27 +02:00
lightnvm.c lightnvm: move metadata mapping to lower level driver 2019-08-06 08:20:10 -06:00
multipath.c nvme-multipath: do not reset on unknown status 2020-10-01 13:17:49 +02:00
nvme.h nvme: introduce nvme_sync_io_queues 2020-11-18 19:20:24 +01:00
pci.c nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN 2021-01-19 18:26:15 +01:00
rdma.c nvme-rdma: avoid repeated request completion 2020-11-18 19:20:24 +01:00
tcp.c nvme-tcp: fix possible data corruption with bio merges 2021-01-19 18:26:17 +01:00
trace.c nvme: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvme-trace: print result and status in hex format 2019-06-21 11:12:37 +02:00