Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1355849lql; Tue, 12 Mar 2024 14:54:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP5OEqltGE8ysDtxdVpQ/f4ZAu9c5/W/QvFb3ApYs13yvX1B3sVLeWwPsksSAMAl7Lh3KASBF2OmPYfcbJcTuL0TYjwcPh+QGl+kmQVw== X-Google-Smtp-Source: AGHT+IHHnb6UNHMxwoUaEZx4i50NCGqLRu0soT+E7+1PABeGoMavSrCortULE4bwEEd4/RaW5cyz X-Received: by 2002:a50:d49b:0:b0:568:7abc:a857 with SMTP id s27-20020a50d49b000000b005687abca857mr1989171edi.39.1710280440105; Tue, 12 Mar 2024 14:54:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710280440; cv=pass; d=google.com; s=arc-20160816; b=zNSltjBomYl+2reTGo78WqKv+xAtIbY30i/f2YAD2OjZuHlrOmiY7eQzJ346niTdEN zPCzzVOMuBdWbKoYHyQFWSIi6WlU1jEcs71HIeQxpAlsPu79bRU+SR0xNneow1DfKxqv P6jsQUuYD4rFo6uSegLSt8mCA7k0vXn1Xgz3Kl0AZmObgiVzN2v3GOWkCmUH770xGe+5 /mbWK6d9dHwofr8NV/yKnbivQvtmfgS7NQKXYyF6MRStH9a+n07gkf6esoUC8eatClEF IosoGIxpBHClfIf8dDPJ4m/x1Glss6/v1b12aVM3uv3eRB1sgrRYhyN95CvsgGtAxZ7K kmKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WRdVUDa2pta5KTvFc1TATmL7fgNoVWU4s2HJtfq2h88=; fh=4NQHijFPgNIHNHCvdNYGZQah13Z+eWG7kcJEjIvNePk=; b=gbOISoklzGESBX7HPTxmSzfK/eMSLgiM/bFFrKUGk+0u4m26u3ZVi9b6k1/chNZao0 A6G6bAYuDfzs6c/MJIJFrhB7/lP9rMDQ759O5xrQchsLy8XuwmR9tTblozhZoqAQ8/ih 4I+qoNG8lpfD+S/T620B7X16UQq2jGG+/eyyJMjVme/IQssPsTjQ5AfoZyYNM5DaViSz XsH6x7nhY67IN81eblY19c202at9qpmIE85Hsm84wVP83+gIh9FOnDhXZelAxSKWauu4 NQxBuugaaLYEkEV+1IIcdQlYI1aWMdMkAKs9hcGwiULbOUocAPq0a3NAfWLQCIH0hC84 xQ7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DcMXjwU6; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-100840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q4-20020a056402032400b00566dedfb08dsi3836635edw.582.2024.03.12.14.54.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 14:54:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DcMXjwU6; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-100840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C974F1F21D54 for ; Tue, 12 Mar 2024 21:53:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5274A14375A; Tue, 12 Mar 2024 21:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="DcMXjwU6" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 228EF143748 for ; Tue, 12 Mar 2024 21:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280429; cv=none; b=lS2LGfXJm5bSE8w1kir/lMSVxrIZFHXnRVFNk6YGHORizu7AKhi+6UQAv+QWkPRGDWg1MmOEUUkhaYEqGK0LzWGxOuEbBgZDeNDhv9s+G8R/YTJE0E5NPiVgUKeqqk370pJWSFbbeK/7wxtdGGDC6trIZey+HAjtuQOe9dXmF1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280429; c=relaxed/simple; bh=G/4hgM5wTxTmcKRjygTzdn2/ODwGo/XzRcupSuCiDhk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P6/xnVuHiJZHGaNHpPCH9DQMjL+YF9k2mUnAHFs1IM2TIJBvghFqi8JIMwW1yjvDO65Eks0SYx9rdSEPm4YE86yRtvfU75DSdi3g8+HeXYgfPeRlqJD8yAWk+GsFRzjZQkdrcyzA5OsjobYQ3Hs0Wtp9zElQhEpK+Ps/EWOnXrU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=DcMXjwU6; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e46dcd8feaso3732040b3a.2 for ; Tue, 12 Mar 2024 14:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710280427; x=1710885227; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=WRdVUDa2pta5KTvFc1TATmL7fgNoVWU4s2HJtfq2h88=; b=DcMXjwU6D7ZrXjjXKE4tykgbSaRw0TFieADBO1R/PU2HXROSSmvjPox8tWcagM2njS UQ0ULslyDc2QlWNuhArc2JqJISt31OdL0q7odDIDghiq4/qqFYNPD+QIzVQSf6MfkSBJ ErRA3azwkH4JAnvq8ZcMaXI00exrsBAVTO1kU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710280427; x=1710885227; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WRdVUDa2pta5KTvFc1TATmL7fgNoVWU4s2HJtfq2h88=; b=FfaA9xmcGbA9JHgRFdDK4OwtCE6H7Tbn+TogBYB3+Qqsn7Dh+NhOxHteoUfqbpvlPs ha7EdvK0fR+fUlzKvugPMFacdGAzbv6tNig1XhA3HuEAp8BxDStZbg1USp/dfgZILmwl MNl7b3Nuo6SCPHmq9XEnhy/OOK905GkPQS0Q9w0tQ2XUKt2OMIyLfAbBTwcLvF86Or0H Bb6ybYsg/wk7VAmnnSBHKbKfuE4JkcQ6lXFt9BdBP1O2l6cDA8grtjfD8qx2R1I7M4tw 8d3qcWn0V0eUxNgJ60DFwnwnkInk8yTz3RYFOgC8dNbDqZR4Gc37PdL8UseHp555m1d0 VQTw== X-Forwarded-Encrypted: i=1; AJvYcCXTCP+gbaUhMQSLvAA/u6lQVicDztfgG9/MrNd4ki9hRc7ffwywMgbVJ1larwtE7yFpJWeV6dOmQ4EMM4VmSihHc9xNgJGB6APzNOVC X-Gm-Message-State: AOJu0Yygdgr0ZbyIq5pSvip1gAHv7SBjCSSVJR6/oVtaBhRlvFX45/KP E3Cpcu5YTjITe4yfO9LmPoBngk5ePmSO3bgfHENcEpBYQivqgcsJC4oDbH+chA== X-Received: by 2002:a05:6a00:4fcb:b0:6e6:afa3:7b32 with SMTP id le11-20020a056a004fcb00b006e6afa37b32mr843588pfb.6.1710280427387; Tue, 12 Mar 2024 14:53:47 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id v21-20020aa78095000000b006e694719fa0sm4235092pff.147.2024.03.12.14.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 14:53:46 -0700 (PDT) Date: Tue, 12 Mar 2024 14:53:46 -0700 From: Kees Cook To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Masahiro Yamada , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 2/2] gcc-plugins: disable plugins when gmp.h is unavailable Message-ID: <202403121452.701C91AF6E@keescook> References: <20240312-gcc-plugins-gmp-v1-0-c5e082437b9e@linutronix.de> <20240312-gcc-plugins-gmp-v1-2-c5e082437b9e@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240312-gcc-plugins-gmp-v1-2-c5e082437b9e@linutronix.de> On Tue, Mar 12, 2024 at 04:03:30PM +0100, Thomas Wei?schuh wrote: > The header gmp.h is meant to be picked up from the host system. > > When it is unavailable the plugin build fails: > > In file included from ../crosstools/gcc-13.2.0-nolibc/i386-linux/bin/../lib/gcc/i386-linux/13.2.0/plugin/include/gcc-plugin.h:28, > from ../scripts/gcc-plugins/gcc-common.h:7, > from ../scripts/gcc-plugins/stackleak_plugin.c:30: > ../crosstools/gcc-13.2.0-nolibc/i386-linux/bin/../lib/gcc/i386-linux/13.2.0/plugin/include/system.h:703:10: fatal error: gmp.h: No such file or directory > 703 | #include > | ^~~~~~~ > > Signed-off-by: Thomas Wei?schuh > --- > scripts/gcc-plugins/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig > index e383cda05367..a664fb5cdde5 100644 > --- a/scripts/gcc-plugins/Kconfig > +++ b/scripts/gcc-plugins/Kconfig > @@ -10,6 +10,7 @@ menuconfig GCC_PLUGINS > depends on HAVE_GCC_PLUGINS > depends on CC_IS_GCC > depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h) > + depends on $(host-cc-option,-include gmp.h) Why does the prior depends not fail? That's where plugin detection is happening. -- Kees Cook