Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1621970rwd; Sun, 21 May 2023 02:38:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56Al1giwhTIQteg2WDr3GVLVZeH9fO5ExICCHuSf2ghRrham2ILjrJAp8/YBV2aPdtbrir X-Received: by 2002:a17:90b:30d6:b0:24b:be0c:6134 with SMTP id hi22-20020a17090b30d600b0024bbe0c6134mr6748228pjb.33.1684661927834; Sun, 21 May 2023 02:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684661927; cv=none; d=google.com; s=arc-20160816; b=SfqFNFhxI4A8VscpiA7myXdQyWFFrtfvSWtk3aW5l6r9l/z5N+lbq/H2OLACloave+ yjbIBRDc5sTDlSzTkg8peFXQZz0vIaoP6He8dseshBbxZakOXV4QYVtfJS4Ahj1msYSd +MRqwkYpu9OZ1U0ChbaxHl9APxz3t+ksmtDE4j5qYeiFVsAcnzoQmGe/oB0Mq87ox3Bd VOyY+zjzirlHXsZNEOLG3lVHkvkhLG/WkHVTpdT5wlwAIQiX/qWiwyr2Z4e1d+7r0ErP QkfVNxQgcYuntHni0DjAceSFG3Wxt0FFTfOZH21h+A4MryPqxmlu397mnNIuHF2r3+H5 kbyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=JgRpTuvzfqyji23GXLUuPQrpl5eo/H6MlvE5+Ks3lGk=; b=A+qkVARe5NmUKFg3z7/5vbCrHfRrxynP8LPUjyBYj22jKqQpjddj4mtAml890gt75h Y6KSybZdAf00DLwnTUwlCfQGgy+NmIxvCH/MjAWDOn5emLru54MFUCvyIFUFz55zTjZM RPIX8plsZmPfc6qu6xuyG6F30noD8Cz/jCDd6SPmCZrWaZi5B9YiqvrY8gCSHnDlWBPQ 3PPniy2xvh2D5A7Mz6ps8rB7KxiV/rQAPA9FXDH0E9gmpPn08J3lm/dGmYk2izzEoB+F wJBJWGocOT2lYqaO1yMVIm0fH6Y8lLpQgWHC/n/Jy5BXPWvXHdcBTj/uOlUd8ax4eC3J kFTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=EVIsm97U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a17090a600e00b002535f1d4bfasi2869522pji.166.2023.05.21.02.38.33; Sun, 21 May 2023 02:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=EVIsm97U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbjEUJhx (ORCPT + 99 others); Sun, 21 May 2023 05:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbjEUJhH (ORCPT ); Sun, 21 May 2023 05:37:07 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B740710D; Sun, 21 May 2023 02:36:46 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1684661803; bh=oLTaTevv3k80SApzPl3sC5k69tzfv/sUdDz9hEu9AXU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EVIsm97U6hspOISLz9ZkoZ//yLstU5Paxq2AbGwXTOMqrQbGKyFY0AH9JSYJPwldQ 4RGacL4K8+kn2z5fmBIN0ip99iQ/Kz5Pturk+/Of9nX1yVmMXX91Xv1Zz15tgi9oY6 3qo9uvtT7IdogZqQbFO5ZQrxu4Quvu8oCON6CzjE= Date: Sun, 21 May 2023 11:36:32 +0200 Subject: [PATCH 4/7] tools/nolibc: add test for __stack_chk_guard initialization MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230521-nolibc-automatic-stack-protector-v1-4-dad6c80c51c1@weissschuh.net> References: <20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net> In-Reply-To: <20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net> To: Willy Tarreau , "Paul E. McKenney" , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684661802; l=737; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=oLTaTevv3k80SApzPl3sC5k69tzfv/sUdDz9hEu9AXU=; b=8XeDn2bNa5olwhqFKmuOVv/Y2l1qpUlcqMMKVlNWL29/GDmokGkH5PtrMdPY2qmVkaOW+rQMG ukmwfsiBBjjBGSgBiSPqAT5uQqfU3LNeeObcPPkOlh4tTWg/TZJiFcq X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index d8b59c8f6c03..995dc39a177e 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -808,6 +808,14 @@ static int run_protection(int min, int max) return 0; #endif +#if defined(NOLIBC_STACKPROTECTOR) + if (!__stack_chk_guard) { + llen += printf("__stack_chk_guard not initialized"); + pad_spc(llen, 64, "[FAIL]\n"); + return 1; + } +#endif + pid = -1; pid = fork(); -- 2.40.1