]> git.karo-electronics.de Git - karo-tx-linux.git/commit
loop: prevent information leak after failed read
authorDmitry Monakhov <dmonakhov@openvz.org>
Wed, 5 Oct 2011 00:42:39 +0000 (11:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 11 Oct 2011 08:43:37 +0000 (19:43 +1100)
commit6df6cfd5bcdc732e38cf84e1f14ad0be83072a8a
tree06078df05e4120f4786419b8521aaa1fcb17faeb
parent6af61a29f762e1afacbaba0a0aaa77d500788a7f
loop: prevent information leak after failed read

If read was not fully successful we have to fail whole bio to prevent
information leak of old pages

##Testcase_begin
dd if=/dev/zero of=./file bs=1M count=1
losetup /dev/loop0 ./file -o 4096
truncate -s 0 ./file
# OOps loop offset is now beyond i_size, so read will silently fail.
# So bio's pages would not be cleared, may which result in information leak.
hexdump -C /dev/loop0
##testcase_end

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/loop.c