[RFC PATCH 5/5] x86: change range of stack overflow checking

From: Mitsuo Hayasaka
Date: Mon Nov 07 2011 - 00:48:06 EST


The original stack overflow checking checks if a stack pointer is
less than or equal to (curbase + THREAD_SIZE) as the 2nd condition.
However, it is not necessary since the 3rd one checks if the pointer
is lower than available stack size. This patch removes the 2nd one.

Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@xxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
---

arch/x86/kernel/irq_64.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index f7baedd..d85b338 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -73,7 +73,6 @@ static inline void stack_overflow_check(struct pt_regs *regs)
panic("low stack detected by irq handler - check messages\n");
#else
if (regs->sp >= curbase &&
- regs->sp <= curbase + THREAD_SIZE &&
regs->sp < curbase + sizeof(struct thread_info) +
sizeof(struct pt_regs) + 128) {
WARN_ONCE(1,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/