]> 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>
Wed, 5 Oct 2011 07:50:30 +0000 (18:50 +1100)
commita2df472ed6318596896a0650a3dfd3faacb60315
tree7d3519f3ffe3a3f32772b2232bc26c3b734a4dbc
parent7658aae7638bcec3eada631ec96e237d1aedeb18
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