diff mbox series

[c,b,x,3/3] block/bio: Do not zero user pages

Message ID 20190627181657.17808-4-marcelo.cerri@canonical.com
State New
Headers show
Series LP: #1834499 - Block Layer Commits Requested in Azure Kernels (for the *generic* kernels) | expand

Commit Message

Marcelo Henrique Cerri June 27, 2019, 6:16 p.m. UTC
From: Keith Busch <keith.busch@intel.com>

BugLink: http://bugs.launchpad.net/bugs/1834499

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>
(cherry picked from commit f55adad601c6a97c8c9628195453e0fb23b4a0ae)
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 block/bio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/bio.c b/block/bio.c
index b1d7e1de7b1a..7dfa9acf1482 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1238,7 +1238,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);
 	}