linux-stable/drivers/staging/zram
Robert Jennings 2787f959d6 zram: Return zero'd pages on new reads
Currently zram will do nothing to the page in the bvec when that page
has not been previously written.  This allows random data to leak to
user space.  That can be seen by doing the following:

 ## Load the module and create a 256Mb zram device called /dev/zram0
 # modprobe zram
 # echo $((256*1024*1024)) > /sys/class/block/zram0/disksize

 ## Initialize the device by writing zero to the first block
 # dd if=/dev/zero of=/dev/zram0 bs=512 count=1

 ## Read ~256Mb of memory into a file and hope for something interesting
 # dd if=/dev/zram0 of=file

This patch will treat an unwritten page as a zero-filled page.  If a
page is read before a write has occurred the data returned is all 0's.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:29:12 -08:00
..
Kconfig zram/xvmalloc: create CONFIG_ZRAM_DEBUG for debug code 2011-02-04 13:29:11 -08:00
Makefile Staging: zram: Makefile: replace the use of <module>-objs with <module>-y 2010-10-08 07:23:41 -07:00
xvmalloc.c zram/xvmalloc: create CONFIG_ZRAM_DEBUG for debug code 2011-02-04 13:29:11 -08:00
xvmalloc.h
xvmalloc_int.h zram/xvmalloc: Close 32byte hole on 64bit CPUs 2011-02-04 13:29:11 -08:00
zram.txt Staging: zram: Update zram documentation 2010-08-31 15:36:36 -07:00
zram_drv.c zram: Return zero'd pages on new reads 2011-02-04 13:29:12 -08:00
zram_drv.h zram: Prevent overflow in logical block size 2011-02-04 13:29:11 -08:00
zram_sysfs.c Staging: zram: round up the disk size provided by user 2011-01-20 16:06:18 -08:00