From: Greg Kroah-Hartman Date: Tue, 9 Jun 2009 23:33:57 +0000 (-0700) Subject: random_int fix for .27 X-Git-Tag: v2.6.27.25~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59ddf69d35490e1fd5b692bbcd8e834482160807;p=thirdparty%2Fkernel%2Fstable-queue.git random_int fix for .27 --- diff --git a/queue-2.6.27/avoid-ice-in-get_random_int-with-gcc-3.4.5.patch b/queue-2.6.27/avoid-ice-in-get_random_int-with-gcc-3.4.5.patch new file mode 100644 index 00000000000..cf9d0b37473 --- /dev/null +++ b/queue-2.6.27/avoid-ice-in-get_random_int-with-gcc-3.4.5.patch @@ -0,0 +1,54 @@ +From 26a9a418237c0b06528941bca693c49c8d97edbe Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Tue, 19 May 2009 11:25:35 -0700 +Subject: Avoid ICE in get_random_int() with gcc-3.4.5 + +From: Linus Torvalds + +commit 26a9a418237c0b06528941bca693c49c8d97edbe upstream. + +Martin Knoblauch reports that trying to build 2.6.30-rc6-git3 with +RHEL4.3 userspace (gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)) causes an +internal compiler error (ICE): + + drivers/char/random.c: In function `get_random_int': + drivers/char/random.c:1672: error: unrecognizable insn: + (insn 202 148 150 0 /scratch/build/linux-2.6.30-rc6-git3/arch/x86/include/asm/tsc.h:23 (set (reg:SI 0 ax [91]) + (subreg:SI (plus:DI (plus:DI (reg:DI 0 ax [88]) + (subreg:DI (reg:SI 6 bp) 0)) + (const_int -4 [0xfffffffffffffffc])) 0)) -1 (nil) + (nil)) + drivers/char/random.c:1672: internal compiler error: in extract_insn, at recog.c:2083 + +and after some debugging it turns out that it's due to the code trying +to figure out the rough value of the current stack pointer by taking an +address of an uninitialized variable and casting that to an integer. + +This is clearly a compiler bug, but it's not worth fighting - while the +current stack kernel pointer might be somewhat hard to predict in user +space, it's also not generally going to change for a lot of the call +chains for a particular process. + +So just drop it, and mumble some incoherent curses at the compiler. + +Tested-by: Martin Knoblauch +Cc: Matt Mackall +Cc: Ingo Molnar +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/random.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -1634,7 +1634,7 @@ unsigned int get_random_int(void) + int ret; + + keyptr = get_keyptr(); +- hash[0] += current->pid + jiffies + get_cycles() + (int)(long)&ret; ++ hash[0] += current->pid + jiffies + get_cycles(); + + ret = half_md4_transform(hash, keyptr->secret); + put_cpu_var(get_random_int_hash); diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 32474d68027..b192e0a8847 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -25,6 +25,7 @@ hwmon-add-missing-__devexit_p.patch igb-fix-lro-warning.patch mm-account-for-map_shared-mappings-using-vm_mayshare-and-not-vm_shared-in-hugetlbfs.patch random-make-get_random_int-more-random.patch +avoid-ice-in-get_random_int-with-gcc-3.4.5.patch selinux-bug-in-selinux-compat_net-code.patch sound-usb-audio-make-the-motu-fastlane-work-again.patch usb-isp1760-urb_dequeue-doesn-t-always-find-the-urbs.patch