From patchwork Wed Dec 21 07:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 707676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tk5mm6bWNz9t0G for ; Wed, 21 Dec 2016 18:26:16 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tk5mm5pcFzDwY5 for ; Wed, 21 Dec 2016 18:26:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tk5mZ1HmgzDwVj for ; Wed, 21 Dec 2016 18:26:05 +1100 (AEDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id uBL7PrKS015614 for ; Wed, 21 Dec 2016 01:25:55 -0600 Message-ID: <1482305153.15937.57.camel@kernel.crashing.org> From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Wed, 21 Dec 2016 18:25:53 +1100 X-Mailer: Evolution 3.22.2 (3.22.2-1.fc25) Mime-Version: 1.0 Subject: [Skiboot] [PATCH] stack: Don't recurse into __stack_chk_fail X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Benjamin Herrenschmidt --- 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(); }