[Skiboot] [PATCH] stack: Don't recurse into __stack_chk_fail
Benjamin Herrenschmidt
benh at kernel.crashing.org
Wed Dec 21 18:25:53 AEDT 2016
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
core/stack.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/core/stack.c b/core/stack.c
index 3b92a14..17a4ca4 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -112,9 +112,14 @@ void backtrace(void)
__print_backtrace(mfspr(SPR_PIR), bt_buf, ents, NULL, NULL, true);
}
-void __noreturn __nomcount __stack_chk_fail(void);
-void __noreturn __nomcount __stack_chk_fail(void)
+void __nomcount __stack_chk_fail(void);
+void __nomcount __stack_chk_fail(void)
{
+ static bool failed_once;
+
+ if (failed_once)
+ return;
+ failed_once = true;
prlog(PR_EMERG, "Stack corruption detected !\n");
abort();
}
More information about the Skiboot
mailing list