block: Fix start and length check added to iov_iter_extract_bvecs() - #1183
block: Fix start and length check added to iov_iter_extract_bvecs()#1183blktests-ci-kpd[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: 66498c7 |
5dd70cb to
055a766
Compare
|
Upstream branch: 502d457 |
a1930cf to
c987306
Compare
|
Upstream branch: 502d457 |
c987306 to
1efc7d7
Compare
055a766 to
341ae8c
Compare
|
Upstream branch: cf72cbb |
1efc7d7 to
906d57f
Compare
341ae8c to
940e422
Compare
|
Upstream branch: cee9395 |
906d57f to
3ee3500
Compare
940e422 to
3cab524
Compare
|
Upstream branch: 89a3129 |
3ee3500 to
c41d311
Compare
|
Upstream branch: 89a3129 |
c41d311 to
fdb736d
Compare
3cab524 to
8242bf1
Compare
|
Upstream branch: bc35965 |
fdb736d to
b52b7cc
Compare
8242bf1 to
5b28f57
Compare
|
Upstream branch: df29080 |
b52b7cc to
544ee6c
Compare
|
Upstream branch: 28924df |
544ee6c to
2d00e18
Compare
4ddd216 to
00cc4ca
Compare
|
Upstream branch: 893e117 |
2d00e18 to
24597fa
Compare
|
Upstream branch: 893e117 |
24597fa to
adda8a2
Compare
|
Upstream branch: 893e117 |
adda8a2 to
47e0157
Compare
00cc4ca to
7efd8cd
Compare
|
Upstream branch: 50d05c7 |
Commit 14b007e 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: 14b007e ("block: validate user space vectors during extraction") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Keith Busch <kbusch@kernel.org> cc: Hannes Reinecke <hare@kernel.org> cc: Christoph Hellwig <hch@infradead.org> cc: Jens Axboe <axboe@kernel.dk> cc: Alexander Viro <viro@zeniv.linux.org.uk> cc: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig <hch@lst.de>
47e0157 to
be587b6
Compare
Pull request for series with
subject: block: Fix start and length check added to iov_iter_extract_bvecs()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1152240