diff mbox

stack: Don't recurse into __stack_chk_fail

Message ID 1482305153.15937.57.camel@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt Dec. 21, 2016, 7:25 a.m. UTC
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 core/stack.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Stewart Smith Dec. 22, 2016, 3:01 a.m. UTC | #1
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  core/stack.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Thanks,
merged:
to master as of d7ffce9096d5a23ee4ff309910983d823e953bd2
to skiboot-5.4.x as of 635cb0ec9d6907803b9fbfc29872c38a44afe906
to skiboot-5.1.x as of 9b35d974cc62df3796c80b9fff0c07fe18912e65
diff mbox

Patch

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();
 }