diff mbox series

block/bio: Do not zero user pages

Message ID 20181210154442.7772-1-keith.busch@intel.com (mailing list archive)
State New, archived
Headers show
Series block/bio: Do not zero user pages | expand

Commit Message

Keith Busch Dec. 10, 2018, 3:44 p.m. UTC
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>
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 block/bio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jens Axboe Dec. 10, 2018, 8:37 p.m. UTC | #1
On 12/10/18 8:44 AM, Keith Busch wrote:
> We don't need to zero fill the bio if not using kernel allocated pages.

Applied, thanks Keith. I added Laurence's Tested-by to the commit.
diff mbox series

Patch

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);
 	}