diff options
author | Andi Kleen <ak@suse.de> | 2005-03-28 03:39:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-28 03:39:37 -0800 |
commit | 1b6499deacd290e6e626c2f649df23161961d718 (patch) | |
tree | 51af4dc90c4148281a41da30f26609114a4fe25f | |
parent | 7eb9a9cf2835ef053410bbbf6e885f69882010f1 (diff) | |
download | history-1b6499deacd290e6e626c2f649df23161961d718.tar.gz |
[PATCH] x86_64: Fix exception stack detection during backtraces
The test in in_exception_stack was done the wrong way round, which lead to
incorrect exception stack detection in the kernel backtracer.
Also fix a off by one in the test.
Noticed by Jan Beulich
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/kernel/traps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index e883cdb0e5153..d87ac6496cc2a 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c @@ -124,10 +124,10 @@ unsigned long *in_exception_stack(int cpu, unsigned long stack) int k; for (k = 0; k < N_EXCEPTION_STACKS; k++) { struct tss_struct *tss = &per_cpu(init_tss, cpu); - unsigned long end = tss->ist[k] + EXCEPTION_STKSZ; + unsigned long start = tss->ist[k] - EXCEPTION_STKSZ; - if (stack >= tss->ist[k] && stack <= end) - return (unsigned long *)end; + if (stack >= start && stack < tss->ist[k]) + return (unsigned long *)tss->ist[k]; } return NULL; } |