Commit aceb27a7 authored by Keith Busch's avatar Keith Busch Committed by Kleber Sacilotto de Souza

block: Clear kernel memory before copying to user

BugLink: http://bugs.launchpad.net/bugs/1834499

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: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
(cherry picked from commit f3587d76)
Signed-off-by: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent d823dfc0
...@@ -1238,6 +1238,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, ...@@ -1238,6 +1238,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
if (ret) if (ret)
goto cleanup; goto cleanup;
} else { } else {
zero_fill_bio(bio);
iov_iter_advance(iter, bio->bi_iter.bi_size); iov_iter_advance(iter, bio->bi_iter.bi_size);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment