summaryrefslogtreecommitdiff
path: root/arch/parisc/kernel/irq.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2017-07-08 23:25:14 +0200
committerHelge Deller <deller@gmx.de>2017-07-23 20:59:45 +0200
commit5bc64bd246ca00e0bb0b7137afaf586f2f66a911 (patch)
treee2546d9b04e9625ccab87e29ccad3a7b9e1beaff /arch/parisc/kernel/irq.c
parenta56e88ec05df50110f2bf578b6e17128f37111ed (diff)
parisc: Disable further stack checks when panic occurs during stack check
Before the irq handler detects a low stack and then panics the kernel, disable further stack checks to avoid recursive panics. Reported-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/kernel/irq.c')
-rw-r--r--arch/parisc/kernel/irq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index ba5e1c7b1f17..5404e4086cb9 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -413,6 +413,10 @@ static inline void stack_overflow_check(struct pt_regs *regs)
if (regs->sr[7])
return;
+ /* exit if already in panic */
+ if (sysctl_panic_on_stackoverflow < 0)
+ return;
+
/* calculate kernel stack usage */
stack_usage = sp - stack_start;
#ifdef CONFIG_IRQSTACKS
@@ -454,8 +458,10 @@ check_kernel_stack:
#ifdef CONFIG_IRQSTACKS
panic_check:
#endif
- if (sysctl_panic_on_stackoverflow)
+ if (sysctl_panic_on_stackoverflow) {
+ sysctl_panic_on_stackoverflow = -1; /* disable further checks */
panic("low stack detected by irq handler - check messages\n");
+ }
#endif
}