[3.13.y-ckt stable] Patch "zram: avoid kunmap_atomic() of a NULL pointer" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Wed Nov 26 21:10:28 UTC 2014
This is a note to let you know that I have just added a patch titled
zram: avoid kunmap_atomic() of a NULL pointer
to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue
This patch is scheduled to be released in version 3.13.11-ckt12.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From 778fe1f361e6bff410e57efc86b5d653ca285244 Mon Sep 17 00:00:00 2001
From: Weijie Yang <weijie.yang at samsung.com>
Date: Thu, 13 Nov 2014 15:19:05 -0800
Subject: zram: avoid kunmap_atomic() of a NULL pointer
commit c406515239376fc93a30d5d03192182160cbd3fb upstream.
zram could kunmap_atomic() a NULL pointer in a rare situation: a zram
page becomes a full-zeroed page after a partial write io. The current
code doesn't handle this case and performs kunmap_atomic() on a NULL
pointer, which panics the kernel.
This patch fixes this issue.
Signed-off-by: Weijie Yang <weijie.yang at samsung.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
Cc: Dan Streetman <ddstreet at ieee.org>
Cc: Nitin Gupta <ngupta at vflare.org>
Cc: Weijie Yang <weijie.yang.kh at gmail.com>
Acked-by: Jerome Marchand <jmarchan at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/staging/zram/zram_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index e2f0add..63c2a5b 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -430,7 +430,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
}
if (page_zero_filled(uncmem)) {
- kunmap_atomic(user_mem);
+ if (user_mem)
+ kunmap_atomic(user_mem);
/* Free memory associated with this sector now. */
zram_free_page(zram, index);
--
1.9.1
More information about the kernel-team
mailing list