Skip to content

Commit

Permalink
block/bio: Do not zero user pages
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Laurence Oberman <[email protected]>
Cc: [email protected]
Cc: Bart Van Assche <[email protected]>
Tested-by: Laurence Oberman <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Keith Busch authored and axboe committed Dec 10, 2018
1 parent 8b878ee commit f55adad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f55adad

Please sign in to comment.