From: Greg Kroah-Hartman Date: Sun, 18 Aug 2013 20:45:41 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.92~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09bf55ea5acaf765b25d40f2474b1ffe0ee075c1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: m68k-truncate-base-in-do_div.patch --- 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 index 00000000000..817714883f8 --- /dev/null +++ b/queue-3.0/m68k-truncate-base-in-do_div.patch @@ -0,0 +1,47 @@ +From ea077b1b96e073eac5c3c5590529e964767fc5f7 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Fri, 9 Aug 2013 15:14:08 +0200 +Subject: m68k: Truncate base in do_div() + +From: Andreas Schwab + +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; \ + }) diff --git a/queue-3.0/series b/queue-3.0/series index 108465b5192..0e8698f15ea 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -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