mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
lib/iov_iter.c: initialize bi.bi_idx before iterating over bvec
Initialize bi.bi_idx as 0 before iterating over bvec, otherwise
garbage data can be used as ->bi_idx.
Cc: Christoph Hellwig <hch@lst.de>
Reported-and-tested-by: Klara Modin <klarasmodin@gmail.com>
Fixes: e4e535bff2
("iov_iter: don't require contiguous pages in iov_iter_extract_bvec_pages")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
133008e84b
commit
496a51b371
@ -1699,6 +1699,7 @@ static ssize_t iov_iter_extract_bvec_pages(struct iov_iter *i,
|
||||
i->bvec++;
|
||||
skip = 0;
|
||||
}
|
||||
bi.bi_idx = 0;
|
||||
bi.bi_size = maxsize + skip;
|
||||
bi.bi_bvec_done = skip;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user