]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Aug 2013 20:45:41 +0000 (13:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Aug 2013 20:45:41 +0000 (13:45 -0700)
added patches:
m68k-truncate-base-in-do_div.patch

queue-3.0/m68k-truncate-base-in-do_div.patch [new file with mode: 0644]
queue-3.0/series

diff --git a/queue-3.0/m68k-truncate-base-in-do_div.patch b/queue-3.0/m68k-truncate-base-in-do_div.patch
new file mode 100644 (file)
index 0000000..8177148
--- /dev/null
@@ -0,0 +1,47 @@
+From ea077b1b96e073eac5c3c5590529e964767fc5f7 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@linux-m68k.org>
+Date: Fri, 9 Aug 2013 15:14:08 +0200
+Subject: m68k: Truncate base in do_div()
+
+From: Andreas Schwab <schwab@linux-m68k.org>
+
+commit ea077b1b96e073eac5c3c5590529e964767fc5f7 upstream.
+
+Explicitly truncate the second operand of do_div() to 32 bits to guard
+against bogus code calling it with a 64-bit divisor.
+
+[Thorsten]
+
+After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with:
+
+btrfs: setting nodatacow, compression disabled
+btrfs: enabling auto recovery
+btrfs: disk space caching is enabled
+---
+ arch/m68k/include/asm/div64.h |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/arch/m68k/include/asm/div64.h
++++ b/arch/m68k/include/asm/div64.h
+@@ -13,16 +13,17 @@
+               unsigned long long n64;                         \
+       } __n;                                                  \
+       unsigned long __rem, __upper;                           \
++      unsigned long __base = (base);                          \
+                                                               \
+       __n.n64 = (n);                                          \
+       if ((__upper = __n.n32[0])) {                           \
+               asm ("divul.l %2,%1:%0"                         \
+-                      : "=d" (__n.n32[0]), "=d" (__upper)     \
+-                      : "d" (base), "0" (__n.n32[0]));        \
++                   : "=d" (__n.n32[0]), "=d" (__upper)        \
++                   : "d" (__base), "0" (__n.n32[0]));         \
+       }                                                       \
+       asm ("divu.l %2,%1:%0"                                  \
+-              : "=d" (__n.n32[1]), "=d" (__rem)               \
+-              : "d" (base), "1" (__upper), "0" (__n.n32[1])); \
++           : "=d" (__n.n32[1]), "=d" (__rem)                  \
++           : "d" (__base), "1" (__upper), "0" (__n.n32[1]));  \
+       (n) = __n.n64;                                          \
+       __rem;                                                  \
+ })
index 108465b5192867c5f361d02f32602396d30268a0..0e8698f15eac9b7fc2b4769c31f743cc3da39be7 100644 (file)
@@ -10,3 +10,4 @@ powerpc-use-mtraceback-no.patch
 m68k-atari-aranym-fix-natfeat-module-support.patch
 arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch
 vm-add-no-mmu-vm_iomap_memory-stub.patch
+m68k-truncate-base-in-do_div.patch