Skip to content
Commit 306df071 authored by Dave Young's avatar Dave Young Committed by Jens Axboe
Browse files

loop: zero fill bio instead of return -EIO for partial read



commit 8268f5a7 ("deny partial write for loop dev fd") tried to fix the
loop device partial read information leak problem.  But it changed the
semantics of read behavior.  When we read beyond the end of the device we
should get 0 bytes, which is normal behavior, we should not just return
-EIO

Instead of returning -EIO, zero out the bio to avoid information leak in
case of partail read.

Signed-off-by: default avatarDave Young <dyoung@redhat.com>
Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
Tested-by: default avatarJeff Moyer <jmoyer@redhat.com>
Cc: Dmitry Monakhov <dmonakhov@sw.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5abebfdd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment