summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2021-01-13 13:56:57 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-19 18:26:17 +0100
commitc70f6e0ac9f9350cd8cf3fcc2e55c5daa776d653 (patch)
tree1f908d1392b30ba9c8a0531e68b5d41c9d13559c /fs/nfs/nfs4proc.c
parent55a102004376860738be22e43f4b6a0f0826c15a (diff)
nvme-tcp: fix possible data corruption with bio merges
commit ca1ff67d0fb14f39cf0cc5102b1fbcc3b14f6fb9 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: 3f2304f8c6d6 ("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>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
0 files changed, 0 insertions, 0 deletions