]> git.baikalelectronics.ru Git - kernel.git/commit
staging: zram: fix invalid memory references during disk write
authorNitin Gupta <ngupta@vflare.org>
Wed, 2 Jan 2013 16:53:41 +0000 (08:53 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jan 2013 03:40:02 +0000 (19:40 -0800)
commitf3d1e0bfcb81ba1da0f0deb48a221e6051736b03
tree3614efa94688c19233023c49d940fe0d3c061cf3
parentccef1133c11a433f8c33fb82a26666a0c2fb282d
staging: zram: fix invalid memory references during disk write

Fixes a bug introduced by commit ab4d0a01d ("zram: Fix handling
of incompressible pages") which caused invalid memory references
during disk write. Invalid references could occur in two cases:
 - Incoming data expands on compression: In this case, reference was
made to kunmap()'ed bio page.
 - Partial (non PAGE_SIZE) write with incompressible data: In this
case, reference was made to a kfree()'ed buffer.

Fixes bug 50081:
https://bugzilla.kernel.org/show_bug.cgi?id=50081

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Cc: stable <stable@vger.kernel.org>
Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
Reported-by: Tomas M <tomas@slax.org>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zram/zram_drv.c