diff options
author | Keith Busch <keith.busch@intel.com> | 2018-11-07 15:37:45 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-07 23:41:31 +0100 |
commit | f3587d76da05f68098ddb1cb3c98cc6a9e8a402c (patch) | |
tree | 8b63b149df907b539e68069d20bcfcfd1480a06d /block | |
parent | MAINTAINERS: Fix remaining pointers to obsolete libata.git (diff) | |
download | linux-f3587d76da05f68098ddb1cb3c98cc6a9e8a402c.tar.xz linux-f3587d76da05f68098ddb1cb3c98cc6a9e8a402c.zip |
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c index 4a5a036268fb..9a9c59067521 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1260,6 +1260,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, if (ret) goto cleanup; } else { + zero_fill_bio(bio); iov_iter_advance(iter, bio->bi_iter.bi_size); } |