diff options
author | Ming Lei <ming.lei@redhat.com> | 2019-04-17 09:11:26 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-19 11:32:14 -0600 |
commit | 6bedf00e55e5dd0a4ed1ad3f06131edd6fb56ec8 (patch) | |
tree | a34352d078072adaff40d3aff0851ea0a87c94a0 /arch/x86/include/uapi | |
parent | b40fabc05ea047f6af5933d26a5483873340b0d4 (diff) | |
download | linux-6bedf00e55e5dd0a4ed1ad3f06131edd6fb56ec8.tar.bz2 |
block: make sure that bvec length can't be overflow
bvec->bv_offset may be bigger than PAGE_SIZE sometimes, such as,
when one bio is splitted in the middle of one bvec via bio_split(),
and bi_iter.bi_bvec_done is used to build offset of the 1st bvec of
remained bio. And the remained bio's bvec may be re-submitted to fs
layer via ITER_IBVEC, such as loop and nvme-loop.
So we have to make sure that every bvec's offset is less than
PAGE_SIZE from bio_for_each_segment_all() because some drivers(loop,
nvme-loop) passes the splitted bvec to fs layer via ITER_BVEC.
This patch fixes this issue reported by Zhang Yi When running nvme/011.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yi Zhang <yi.zhang@redhat.com>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Fixes: 6dc4f100c175 ("block: allow bio_for_each_segment_all() to iterate over multi-page bvec")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'arch/x86/include/uapi')
0 files changed, 0 insertions, 0 deletions