]> 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>
Thu, 6 Oct 2011 05:48:57 +0000 (16:48 +1100)
commit3485152eff7b608544b70c59f698022ee71d8077
tree77b02a2033c7a24cacb54339458c087d10e5e29a
parent367e5e9e4f4581af229ff135b8cf0b1615abdd8d
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