diff options
author | Keith Busch <keith.busch@intel.com> | 2018-12-10 08:44:42 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-12-10 13:37:20 -0700 |
commit | f55adad601c6a97c8c9628195453e0fb23b4a0ae (patch) | |
tree | f6a5d0dab3a284d07ef41707c472ced428da94d7 /block/bio.c | |
parent | 8b878ee247ef2691bd69e1bc3df5ae93738ea028 (diff) | |
download | linux-f55adad601c6a97c8c9628195453e0fb23b4a0ae.tar.gz linux-f55adad601c6a97c8c9628195453e0fb23b4a0ae.tar.bz2 linux-f55adad601c6a97c8c9628195453e0fb23b4a0ae.zip |
block/bio: Do not zero user pages
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>
Diffstat (limited to 'block/bio.c')
-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 4f4d9884443b..4d86e90654b2 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1261,7 +1261,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); } |