Files
erofs-linux/lib
David Howells 57a78ad230 block: Fix start and length check added to iov_iter_extract_bvecs()
Commit 14b007e178 added an address check using iter_iov_addr() and a
length check using iter_iov_len() to iov_iter_extract_bvecs(), but these
cannot be used so and are unsafe in this circumstance as the functions have
hardwired assumptions about the iterator type.  They should only be used
with ITER_UBUF or ITER_IOVEC-type iterators; they shouldn't be used with
ITER_BVEC, ITER_KVEC, ITER_FOLIOQ, ITER_XARRAY or ITER_DISCARD iterators.

This proves to be a problem for cachefiles as an iterator of type
ITER_FOLIOQ is passed and iter_iov_addr() and iter_iov_len() both
malfunction because iter->__iov in iter_iov() is not pointing to an iovec
array.

Fix this by using iov_iter_alignment() instead.

Fixes: 14b007e178 ("block: validate user space vectors during extraction")
Signed-off-by: David Howells <[email protected]>
Link: https://patch.msgid.link/[email protected]
Reviewed-by: Keith Busch <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
cc: Hannes Reinecke <[email protected]>
cc: Christoph Hellwig <[email protected]>
cc: Jens Axboe <[email protected]>
cc: Alexander Viro <[email protected]>
cc: Paulo Alcantara <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner (Amutable) <[email protected]>
2026-09-10 09:20:39 +02:00
..
…
…
2026-08-03 21:10:16 -07:00
2026-08-13 15:42:05 -07:00
…
…
…
2026-03-05 22:16:08 -05:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-07-31 10:09:12 +02:00
…
…
…
…
2026-01-11 06:09:11 -10:00
2026-02-27 16:40:16 +01:00
…
…
…
…
…
2026-04-18 00:10:48 -07:00
…
…
…