diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-08 14:14:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-08 14:14:32 -0400 |
commit | 8d659f5e43c5db2630e85f507b7384365e9e1c1e (patch) | |
tree | c99b00949268cedbbc4bc1f3e01b058e67033c2e /arch/sparc64/kernel/stacktrace.c | |
parent | 9da1f7e69aa4545d45d3435865c56f1e67c4b26a (diff) | |
parent | 433c5f706856689be25928a99636e724fb3ea7cf (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Fix end-of-stack checking in save_stack_trace().
sparc: don't use asm/of_device.h
sparc64: Use kernel/uid16.c helpers instead of own copy.
of/sparc: remove include of linux/of_platform.h from asm/of_platform.h
sparc: i8042-sparcio.h: fix warning
Diffstat (limited to 'arch/sparc64/kernel/stacktrace.c')
-rw-r--r-- | arch/sparc64/kernel/stacktrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c index b3e3737750d8..e9d7f0660f2e 100644 --- a/arch/sparc64/kernel/stacktrace.c +++ b/arch/sparc64/kernel/stacktrace.c | |||
@@ -26,13 +26,15 @@ void save_stack_trace(struct stack_trace *trace) | |||
26 | 26 | ||
27 | /* Bogus frame pointer? */ | 27 | /* Bogus frame pointer? */ |
28 | if (fp < (thread_base + sizeof(struct thread_info)) || | 28 | if (fp < (thread_base + sizeof(struct thread_info)) || |
29 | fp >= (thread_base + THREAD_SIZE)) | 29 | fp > (thread_base + THREAD_SIZE - sizeof(struct sparc_stackf))) |
30 | break; | 30 | break; |
31 | 31 | ||
32 | sf = (struct sparc_stackf *) fp; | 32 | sf = (struct sparc_stackf *) fp; |
33 | regs = (struct pt_regs *) (sf + 1); | 33 | regs = (struct pt_regs *) (sf + 1); |
34 | 34 | ||
35 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 35 | if (((unsigned long)regs <= |
36 | (thread_base + THREAD_SIZE - sizeof(*regs))) && | ||
37 | (regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | ||
36 | if (!(regs->tstate & TSTATE_PRIV)) | 38 | if (!(regs->tstate & TSTATE_PRIV)) |
37 | break; | 39 | break; |
38 | pc = regs->tpc; | 40 | pc = regs->tpc; |