From: "Andi Kleen" <ak@suse.de>

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>
---

 25-akpm/arch/x86_64/kernel/traps.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN arch/x86_64/kernel/traps.c~x86_64-fix-exception-stack-detection-during-backtraces arch/x86_64/kernel/traps.c
--- 25/arch/x86_64/kernel/traps.c~x86_64-fix-exception-stack-detection-during-backtraces	Wed Mar 23 15:39:10 2005
+++ 25-akpm/arch/x86_64/kernel/traps.c	Wed Mar 23 15:39:10 2005
@@ -124,10 +124,10 @@ unsigned long *in_exception_stack(int cp
 	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;
 } 
_