<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: "Andi Kleen" &lt;ak@suse.de&gt;

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 &lt;ak@suse.de&gt;
Cc: &lt;jbeulich@novell.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 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 &lt; N_EXCEPTION_STACKS; k++) {
 		struct tss_struct *tss = &amp;per_cpu(init_tss, cpu);
-		unsigned long end = tss-&gt;ist[k] + EXCEPTION_STKSZ;
+		unsigned long start = tss-&gt;ist[k] - EXCEPTION_STKSZ;
 
-		if (stack &gt;= tss-&gt;ist[k]  &amp;&amp; stack &lt;= end)
-			return (unsigned long *)end;
+		if (stack &gt;= start &amp;&amp; stack &lt; tss-&gt;ist[k])
+			return (unsigned long *)tss-&gt;ist[k];
 	}
 	return NULL;
 } 
_
</pre></body></html>