diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-19 14:25:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-19 14:25:35 -0400 |
commit | 26a9a418237c0b06528941bca693c49c8d97edbe (patch) | |
tree | 79a474f9ff9029362542938c0b82155455445369 /drivers | |
parent | 7ee2cb7f32b299c2b06a31fde155457203e4b7dd (diff) |
Avoid ICE in get_random_int() with gcc-3.4.5
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 <spamtrap@knobisoft.de>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/random.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index b2ced39d76b2..8c7444857a4b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1673,7 +1673,7 @@ unsigned int get_random_int(void) | |||
1673 | int ret; | 1673 | int ret; |
1674 | 1674 | ||
1675 | keyptr = get_keyptr(); | 1675 | keyptr = get_keyptr(); |
1676 | hash[0] += current->pid + jiffies + get_cycles() + (int)(long)&ret; | 1676 | hash[0] += current->pid + jiffies + get_cycles(); |
1677 | 1677 | ||
1678 | ret = half_md4_transform(hash, keyptr->secret); | 1678 | ret = half_md4_transform(hash, keyptr->secret); |
1679 | put_cpu_var(get_random_int_hash); | 1679 | put_cpu_var(get_random_int_hash); |