diff options
author | Keith Busch <keith.busch@intel.com> | 2018-12-10 18:44:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-19 21:19:50 +0300 |
commit | 7290c71ded83bad817ed7b4827afd725e81f20d0 (patch) | |
tree | 6cd3fcb512adaa473ce8926d55968cd059b931a3 /block | |
parent | beb98fda1853639bb7312da746d49a33a1325ddf (diff) | |
download | linux-7290c71ded83bad817ed7b4827afd725e81f20d0.tar.xz |
block/bio: Do not zero user pages
commit f55adad601c6a97c8c9628195453e0fb23b4a0ae upstream.
We don't need to zero fill the bio if not using kernel allocated pages.
Fixes: f3587d76da05 ("block: Clear kernel memory before copying to user") # v4.20-rc2
Reported-by: Todd Aiken <taiken@mvtech.ca>
Cc: Laurence Oberman <loberman@redhat.com>
Cc: stable@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>
Tested-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c index c4ef8aa46452..55a5386fd431 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1262,7 +1262,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q, if (ret) goto cleanup; } else { - zero_fill_bio(bio); + if (bmd->is_our_pages) + zero_fill_bio(bio); iov_iter_advance(iter, bio->bi_iter.bi_size); } |