From patchwork Thu Feb 20 02:01:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1241104 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NHrY3Tcxz9sRs for ; Thu, 20 Feb 2020 13:01:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 408E3860FC; Thu, 20 Feb 2020 02:01:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3EYxg8QAQTpS; Thu, 20 Feb 2020 02:01:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C819861A2; Thu, 20 Feb 2020 02:01:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 8C67A1BF298 for ; Thu, 20 Feb 2020 02:01:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 87790204A7 for ; Thu, 20 Feb 2020 02:01:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ucymcPj6-JCF for ; Thu, 20 Feb 2020 02:01:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by silver.osuosl.org (Postfix) with ESMTPS id B52991FEBF for ; Thu, 20 Feb 2020 02:01:25 +0000 (UTC) X-Originating-IP: 173.221.118.3 Received: from localhost (173.221.118.3.nw.nuvox.net [173.221.118.3]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 1DCE2FF805; Thu, 20 Feb 2020 02:01:22 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Thu, 20 Feb 2020 03:01:14 +0100 Message-Id: <20200220020117.695236-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> References: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/3] toolchain: add hidden BR2_TOOLCHAIN_HAS_SSP_STRONG boolean X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , Romain Naour , Fabrice Fontaine , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This will allow toolchain to indicate if they support -fstack-protector-strong or not. Whenever the gcc version is >= 4.9, we always have SSP_STRONG support if we have SSP support. However, some toolchains older than gcc 4.9 might have backported SSP_STRONG support, which is why we cannot rely just on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9. Having this "default" value allows to avoid adding a "select BR2_TOOLCHAIN_HAS_SSP_STRONG" in the internal toolchain logic plus in almost external toolchains. But it allows custom external toolchains that are pre-4.9 to potentially declare that they support strong SSP. Signed-off-by: Thomas Petazzoni --- toolchain/Config.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolchain/Config.in b/toolchain/Config.in index 973c03254f..87509f3d64 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -189,6 +189,10 @@ config BR2_TOOLCHAIN_HAS_THREADS_NPTL config BR2_TOOLCHAIN_HAS_SSP bool +config BR2_TOOLCHAIN_HAS_SSP_STRONG + bool + default y if BR2_TOOLCHAIN_HAS_SSP && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 + config BR2_TOOLCHAIN_HAS_UCONTEXT bool From patchwork Thu Feb 20 02:01:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1241105 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NHrf4KQYz9sRG for ; Thu, 20 Feb 2020 13:01:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9069B84EC1; Thu, 20 Feb 2020 02:01:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nVvOAvvf2tie; Thu, 20 Feb 2020 02:01:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 529EC8459B; Thu, 20 Feb 2020 02:01:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 893AE1BF298 for ; Thu, 20 Feb 2020 02:01:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 817971FEBF for ; Thu, 20 Feb 2020 02:01:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OfH026xxhjQy for ; Thu, 20 Feb 2020 02:01:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by silver.osuosl.org (Postfix) with ESMTPS id 23E6420355 for ; Thu, 20 Feb 2020 02:01:29 +0000 (UTC) X-Originating-IP: 173.221.118.3 Received: from localhost (173.221.118.3.nw.nuvox.net [173.221.118.3]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 8F1811C0005; Thu, 20 Feb 2020 02:01:26 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Thu, 20 Feb 2020 03:01:15 +0100 Message-Id: <20200220020117.695236-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> References: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/3] toolchain/toolchain-external/toolchain-external-custom: add option to indicate SSP_STRONG support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , Romain Naour , Fabrice Fontaine , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit adds a user-visible option BR2_TOOLCHAIN_EXTERNAL_HAS_SSP_STRONG, which will allow the user to indicate if the custom external toolchain does or does not have SSP_STRONG support. Depending on this, the user will be able to use (or not) the BR2_SSP_STRONG option. Checking if what the user said is true or not about this is already done in toolchain/toolchain-external/pkg-toolchain-external.mk: $$(Q)$$(call check_toolchain_ssp,$$(TOOLCHAIN_EXTERNAL_CC),$(BR2_SSP_OPTION)) If the user selects BR2_SSP_STRONG, this will check if -fstack-protector-strong is really supported. Signed-off-by: Thomas Petazzoni --- .../toolchain-external-custom/Config.in.options | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options index 302f6babac..c8cd2c03cc 100644 --- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options +++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options @@ -410,6 +410,18 @@ config BR2_TOOLCHAIN_EXTERNAL_HAS_SSP leave the default value, Buildroot will tell you if it's correct or not. +config BR2_TOOLCHAIN_EXTERNAL_HAS_SSP_STRONG + bool "Toolchain has SSP strong support?" + default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 && BR2_TOOLCHAIN_EXTERNAL_GLIBC + default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 && BR2_TOOLCHAIN_EXTERNAL_MUSL + depends on BR2_TOOLCHAIN_EXTERNAL_HAS_SSP + select BR2_TOOLCHAIN_HAS_SSP_STRONG + help + Selection this option if your external toolchain has strong + Stack Smashing Protection support enabled. If you don't + know, leave the default value, Buildroot will tell you if + it's correct or not. + config BR2_TOOLCHAIN_EXTERNAL_INET_RPC bool "Toolchain has RPC support?" default y if BR2_TOOLCHAIN_EXTERNAL_GLIBC From patchwork Thu Feb 20 02:01:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1241106 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NHrf6n0Nz9sRs for ; Thu, 20 Feb 2020 13:01:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1FB102078B; Thu, 20 Feb 2020 02:01:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vO+pIzs40HtI; Thu, 20 Feb 2020 02:01:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2EC2A20355; Thu, 20 Feb 2020 02:01:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D37371BF298 for ; Thu, 20 Feb 2020 02:01:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C2AC98459A for ; Thu, 20 Feb 2020 02:01:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Enqm78x3GKId for ; Thu, 20 Feb 2020 02:01:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 153E984595 for ; Thu, 20 Feb 2020 02:01:31 +0000 (UTC) X-Originating-IP: 173.221.118.3 Received: from localhost (173.221.118.3.nw.nuvox.net [173.221.118.3]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id BA4991C0007; Thu, 20 Feb 2020 02:01:29 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Thu, 20 Feb 2020 03:01:16 +0100 Message-Id: <20200220020117.695236-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> References: <20200220020117.695236-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] Config.in: ensure BR2_SSP_STRONG can only be selected if supported X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit ensures that BR2_SSP_STRONG cannot be chosen if the toolchain doesn't support strong SSP. Fixes: http://autobuild.buildroot.net/results/cba93a681d10692c4e4c5584e4c962bd18a608d4/ Signed-off-by: Thomas Petazzoni --- Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Config.in b/Config.in index 5a4239bc9a..2913d39ec8 100644 --- a/Config.in +++ b/Config.in @@ -758,6 +758,7 @@ config BR2_SSP_REGULAR config BR2_SSP_STRONG bool "-fstack-protector-strong" + depends on BR2_TOOLCHAIN_HAS_SSP_STRONG help Like -fstack-protector but includes additional functions to be protected - those that have local array definitions, or have