Linux PARISC architecture development
 help / color / mirror / Atom feed
* [PATCH] parisc: Disable further stack checks when panic occurs during stack check
@ 2017-07-08 21:25 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2017-07-08 21:25 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

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>

diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index ba5e1c7..5404e40 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 @@ static inline void stack_overflow_check(struct pt_regs *regs)
 #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
 }
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-08 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08 21:25 [PATCH] parisc: Disable further stack checks when panic occurs during stack check Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox