]> git.karo-electronics.de Git - karo-tx-linux.git/commit
loop: prevent information leak after failed read
authorDmitry Monakhov <dmonakhov@openvz.org>
Mon, 24 Oct 2011 14:53:50 +0000 (01:53 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 7 Nov 2011 02:40:24 +0000 (13:40 +1100)
commite4ce328a44c43f607daa1342c27728420761f4dc
treec9a2d5ed023211add46e19893692331c80708af1
parentb5c7dd4bedba6339b2e24051708f496de457fd72
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