]> git.baikalelectronics.ru Git - kernel.git/commit
loop: zero fill bio instead of return -EIO for partial read
authorDave Young <dyoung@redhat.com>
Wed, 8 Feb 2012 21:07:19 +0000 (22:07 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 8 Feb 2012 21:07:19 +0000 (22:07 +0100)
commitfc6bf223bf3a84bcc71aad2430aa2389dd211136
treec32e636516980e9f2708022e314f370a13198ecd
parent6f0faa84ad081d0d27dfbebc20bd839d4804a1ae
loop: zero fill bio instead of return -EIO for partial read

commit cbbe7a981a ("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: Dave Young <dyoung@redhat.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Tested-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Dmitry Monakhov <dmonakhov@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c