]> 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>
Fri, 14 Oct 2011 06:19:38 +0000 (17:19 +1100)
commit98ab9383e8bf34a179c25a99e283587bd66276a4
treec8a1566e1b03707f8cf687af71c618e42d4fbc3e
parent5d2ec6e5868e64c499d6addf065afeb897772b44
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