Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4896256imm; Tue, 31 Jul 2018 01:52:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcdY+14vm5H4QoEy4V5uoahYfF1z2l5w1uzO91xBe6sMeDBFdDJPGA6eAG+0/q3iKnfDqSh X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr19561808pgw.427.1533027143079; Tue, 31 Jul 2018 01:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533027143; cv=none; d=google.com; s=arc-20160816; b=v6JtWuMZ+PmIE6iBzqBhVQHlScGR1iYSD4uo6wRvG/iRH31dFogwQr7gLV4+mnwMMP iUfNmg9lJSZO+XPP0Opx8VB+dXP934tluPobJn/61ELa4YifCIf2VCEMz7mk8X30Lfky gy+HzQDsB+OhnsJfdlVZzF0KT3SGLxgxOAznto9OEDhFkRfdawz42dHowURbXbhFDui6 57gJISqQseqapuF9+wQ42E8Ma+BvELu/FEwbV+fi8Mk6plHU0x6n91rM08SOolYEDMXx XnN+0fSAF+o/61tmKVbJqg2tfNgaDS0CeSEZhRUZ1J1QCru64dhNUJLoHqfUKl+VXKDH a8HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=w90DiIOqZ84JeJ7b6Nwbrqgb6GKdtTeEAJNy9ylui1c=; b=d6xAF28GkD/9jNC77Q7oWs46zCSJGHHi60ESouJ27No7YzNO1HdACMvOPeFnoVe8k4 XbpkLxS1q7ROgTk7ZjoBMFo4R172IApr8i63bcWouUb4q7C5FUSA0YdviRGm9Z4w2CZ1 Y6fdcjuWrsTRSnE/PjWswsVqSTJWjRmrzDZ6oh9C2/mrL5TZaAm2pVs3sMpFieCjMEM3 6r9BNL/LbvCGOAjNVghB5bJgIyyKgEq5iSBFuaOUVAeeudQ6swTl5jZ07yt6I1nAPEF3 mIMYTxeSzLA3/83d821Mj0SqLjuF5xH0AnXU7xSopp+IHjdYG40OMNNU2jLksETNcDUc kqoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d62-v6si1124308pfd.334.2018.07.31.01.52.08; Tue, 31 Jul 2018 01:52:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729779AbeGaKag (ORCPT + 99 others); Tue, 31 Jul 2018 06:30:36 -0400 Received: from foss.arm.com ([217.140.101.70]:50260 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729224AbeGaKag (ORCPT ); Tue, 31 Jul 2018 06:30:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC0851596; Tue, 31 Jul 2018 01:51:19 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7D01F3F5BA; Tue, 31 Jul 2018 01:51:19 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 5A2961AE2F57; Tue, 31 Jul 2018 09:51:21 +0100 (BST) Date: Tue, 31 Jul 2018 09:51:21 +0100 From: Will Deacon To: Laura Abbott Cc: Stephen Rothwell , Kees Cook , Linux-Next Mailing List , Linux Kernel Mailing List , Alexander Popov , Catalin Marinas Subject: Re: [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Message-ID: <20180731085121.GC4680@arm.com> References: <20180730163722.GD4276@arm.com> <20180730183118.25869-1-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180730183118.25869-1-labbott@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 11:31:18AM -0700, Laura Abbott wrote: > arm64 uses the full KBUILD_CFLAGS for building libstub as opposed > to x86 which doesn't. This means that x86 doesn't pick up > the gcc-plugins. We need to disable the stackleak plugin but > doing this unconditionally breaks x86 build since it doesn't > have any plugins. Switch to disabling the stackleak plugin for > arm64 only. > > Signed-off-by: Laura Abbott > --- > drivers/firmware/efi/libstub/Makefile | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Cheers, Laura, I'll pick this up today. I think we'll need the same thing for 32-bit ARM if/when they enable support for the plugin. Will > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile > index 25dd2a14560d..88c322d7c71e 100644 > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -11,7 +11,10 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ > -fPIC -fno-strict-aliasing -mno-red-zone \ > -mno-mmx -mno-sse -fshort-wchar > > -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie > +# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly > +# disable the stackleak plugin > +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ > + $(DISABLE_STACKLEAK_PLUGIN) > cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ > -fno-builtin -fpic -mno-single-pic-base > > @@ -21,7 +24,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \ > -D__NO_FORTIFY \ > $(call cc-option,-ffreestanding) \ > $(call cc-option,-fno-stack-protector) \ > - $(DISABLE_STACKLEAK_PLUGIN) > > GCOV_PROFILE := n > KASAN_SANITIZE := n > -- > 2.17.1 >