Skip to content

block: Fix start and length check added to iov_iter_extract_bvecs() - #1183

Open
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1152240=>linus-master
Open

block: Fix start and length check added to iov_iter_extract_bvecs()#1183
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1152240=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

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

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 66498c7
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152240
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 502d457
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152290
version: 2

@blktests-ci-kpd blktests-ci-kpd Bot added V2 and removed V1 labels Aug 26, 2026
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from a1930cf to c987306 Compare August 26, 2026 20:54
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 502d457
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152290
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from c987306 to 1efc7d7 Compare August 26, 2026 21:35
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: cf72cbb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152290
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 1efc7d7 to 906d57f Compare August 29, 2026 06:38
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: cee9395
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152290
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 906d57f to 3ee3500 Compare August 31, 2026 10:38
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 89a3129
series: https://patchwork.kernel.org/project/linux-block/list/?series=1152290
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 3ee3500 to c41d311 Compare September 2, 2026 08:54
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 89a3129
series: https://patchwork.kernel.org/project/linux-block/list/?series=1156366
version: 11

@blktests-ci-kpd blktests-ci-kpd Bot added V11 and removed V2 labels Sep 2, 2026
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from c41d311 to fdb736d Compare September 2, 2026 17:38
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: bc35965
series: https://patchwork.kernel.org/project/linux-block/list/?series=1156366
version: 11

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from fdb736d to b52b7cc Compare September 4, 2026 06:08
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: df29080
series: https://patchwork.kernel.org/project/linux-block/list/?series=1156366
version: 11

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from b52b7cc to 544ee6c Compare September 7, 2026 04:25
@blktests-ci-kpd blktests-ci-kpd Bot closed this Sep 7, 2026
@blktests-ci-kpd blktests-ci-kpd Bot reopened this Sep 8, 2026
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 28924df
series: https://patchwork.kernel.org/series/1159736/
version: 3

@blktests-ci-kpd blktests-ci-kpd Bot added V3 and removed V11 labels Sep 8, 2026
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 544ee6c to 2d00e18 Compare September 8, 2026 15:25
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1159736/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 2d00e18 to 24597fa Compare September 9, 2026 07:45
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1161118/
version: 4

@blktests-ci-kpd blktests-ci-kpd Bot added V4 and removed V3 labels Sep 9, 2026
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 24597fa to adda8a2 Compare September 9, 2026 08:37
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1161118/
version: 4

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from adda8a2 to 47e0157 Compare September 10, 2026 06:07
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1161118/
version: 4

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>
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1152240=>linus-master branch from 47e0157 to be587b6 Compare September 10, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant