Files
linux/lib
David Howells b15d3cbd29 iov_iter: Fix iov_iter_extract_pages() with zero-sized entries
commit f741bd7178 upstream.

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: 7d58fe7310 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:48:42 +02:00
..
2023-03-06 15:54:54 -08:00
2023-04-08 13:45:37 -07:00
2023-02-02 22:50:01 -08:00
2023-02-02 22:50:01 -08:00
2023-02-15 15:44:43 +01:00
2023-03-19 10:02:04 -07:00
2023-04-17 18:01:23 +02:00
2023-09-13 09:47:55 +02:00
2023-01-27 11:42:57 -08:00