From nobody Mon Feb 9 12:15:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F080C7EE43 for ; Mon, 12 Jun 2023 20:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238114AbjFLUtH (ORCPT ); Mon, 12 Jun 2023 16:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233679AbjFLUrd (ORCPT ); Mon, 12 Jun 2023 16:47:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C074919A7 for ; Mon, 12 Jun 2023 13:46:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A38D062F0F for ; Mon, 12 Jun 2023 20:45:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E9BFC4331E; Mon, 12 Jun 2023 20:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686602717; bh=NIJsLUCkPm+SlEyAKKZ+JWMSEL2gT9Xxru+zz8R8kig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qdpXve/ZQctJnAKEwXta+3CR84M0ydiwRgzAwsMvH+1IVHWwYSAf8I9HzbiRvUT6W nEL3XqqPScLydNBucfB4/Cb4mpR/g1Y7Vtna80a8ClLUjqDHRezODsChULKNiX/6ei luDd3+JfPrEVZx35Vol9KWiwWvMGJQyvjjiweLJtztuodVVrYaLIMO51atRhVQHFkK qFpZ5OnQPZ7rbvCIAgYjoeeAHPrbiLeftANE8uGxkAbFZoM4PJPF5b7a9jekXnMmyq uEVUTxmMD17Xrm85eTlMWXeDc0vigOnVMnGYXpA/FtSVSUaG9/jJqfCit1c3KMqxKo 9f0Tw0/Q+ABew== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E89F0CE3A70; Mon, 12 Jun 2023 13:45:15 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Willy Tarreau , "Paul E . McKenney" Subject: [PATCH v2 nolibc 28/53] tools/nolibc: add test for __stack_chk_guard initialization Date: Mon, 12 Jun 2023 13:44:49 -0700 Message-Id: <20230612204514.292087-28-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> References: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- 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/s= elftests/nolibc/nolibc-test.c index d5d4dea63cd6..861b9a74b71f 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 =20 +#if defined(NOLIBC_STACKPROTECTOR) + if (!__stack_chk_guard) { + llen +=3D printf("__stack_chk_guard not initialized"); + pad_spc(llen, 64, "[FAIL]\n"); + return 1; + } +#endif + pid =3D -1; pid =3D fork(); =20 --=20 2.40.1