Skip to content

Commit f55adad

Browse files
Keith Buschaxboe
authored andcommitted
block/bio: Do not zero user pages
We don't need to zero fill the bio if not using kernel allocated pages. Fixes: f3587d7 ("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>
1 parent 8b878ee commit f55adad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

block/bio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
12611261
if (ret)
12621262
goto cleanup;
12631263
} else {
1264-
zero_fill_bio(bio);
1264+
if (bmd->is_our_pages)
1265+
zero_fill_bio(bio);
12651266
iov_iter_advance(iter, bio->bi_iter.bi_size);
12661267
}
12671268

0 commit comments

Comments
 (0)