summaryrefslogtreecommitdiff
path: root/lib/logic_iomem.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-09-08 19:03:20 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-10 01:11:49 +0300
commitf741bd7178c95abd7aeac5a9d933ee542f9a5509 (patch)
tree2daa2aee81598fcf690d39ac2424ef90173c00b9 /lib/logic_iomem.c
parent6b8bb5b8d9b35fb43f0dbf9fd91b7d35e6232e08 (diff)
downloadlinux-f741bd7178c95abd7aeac5a9d933ee542f9a5509.tar.xz
iov_iter: Fix iov_iter_extract_pages() with zero-sized entries
iov_iter_extract_pages() doesn't correctly handle skipping over initial zero-length entries in ITER_KVEC and ITER_BVEC-type iterators. The problem is that it accidentally reduces maxsize to 0 when it skipping and thus runs to the end of the array and returns 0. Fix this by sticking the calculated size-to-copy in a new variable rather than back in maxsize. Fixes: 7d58fe731028 ("iov_iter: Add a function to extract a page list from an iterator") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Christian Brauner <brauner@kernel.org> Cc: Jens Axboe <axboe@kernel.dk> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: David Hildenbrand <david@redhat.com> Cc: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/logic_iomem.c')
0 files changed, 0 insertions, 0 deletions