Skip to content

Commit f3587d7

Browse files
Keith Buschaxboe
authored andcommitted
block: Clear kernel memory before copying to user
If the kernel allocates a bounce buffer for user read data, this memory needs to be cleared before copying it to the user, otherwise it may leak kernel memory to user space. Laurence Oberman <loberman@redhat.com> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e31d36b commit f3587d7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/bio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
12601260
if (ret)
12611261
goto cleanup;
12621262
} else {
1263+
zero_fill_bio(bio);
12631264
iov_iter_advance(iter, bio->bi_iter.bi_size);
12641265
}
12651266

0 commit comments

Comments
 (0)