]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Nov 2014 17:23:00 +0000 (09:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Nov 2014 17:23:00 +0000 (09:23 -0800)
added patches:
zram-avoid-kunmap_atomic-of-a-null-pointer.patch

queue-3.14/series
queue-3.14/zram-avoid-kunmap_atomic-of-a-null-pointer.patch [new file with mode: 0644]

index 0ffff676c12b8495244fa63e268b5ea1ad38d7e8..ea617d601f84d9573783c3898bef8ff6375f3d31 100644 (file)
@@ -15,3 +15,4 @@ sunvdc-don-t-call-vd_op_get_vtoc.patch
 sparc64-fix-crashes-in-schizo_pcierr_intr_other.patch
 sparc64-do-irq_-enter-exit-around-generic_smp_call_function.patch
 sparc32-implement-xchg-and-atomic_xchg-using-atomic_hash-locks.patch
+zram-avoid-kunmap_atomic-of-a-null-pointer.patch
diff --git a/queue-3.14/zram-avoid-kunmap_atomic-of-a-null-pointer.patch b/queue-3.14/zram-avoid-kunmap_atomic-of-a-null-pointer.patch
new file mode 100644 (file)
index 0000000..8b2eb76
--- /dev/null
@@ -0,0 +1,42 @@
+From c406515239376fc93a30d5d03192182160cbd3fb Mon Sep 17 00:00:00 2001
+From: Weijie Yang <weijie.yang@samsung.com>
+Date: Thu, 13 Nov 2014 15:19:05 -0800
+Subject: zram: avoid kunmap_atomic() of a NULL pointer
+
+From: Weijie Yang <weijie.yang@samsung.com>
+
+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@samsung.com>
+Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Cc: Dan Streetman <ddstreet@ieee.org>
+Cc: Nitin Gupta <ngupta@vflare.org>
+Cc: Weijie Yang <weijie.yang.kh@gmail.com>
+Acked-by: Jerome Marchand <jmarchan@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/block/zram/zram_drv.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/block/zram/zram_drv.c
++++ b/drivers/block/zram/zram_drv.c
+@@ -447,7 +447,8 @@ static int zram_bvec_write(struct zram *
+       }
+       if (page_zero_filled(uncmem)) {
+-              kunmap_atomic(user_mem);
++              if (user_mem)
++                      kunmap_atomic(user_mem);
+               /* Free memory associated with this sector now. */
+               write_lock(&zram->meta->tb_lock);
+               zram_free_page(zram, index);