Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4273807imm; Mon, 30 Jul 2018 11:33:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfb5UW42tYiFD4/Gqsac/lkz1yeyIRHLHyHzheUXFHslYwzEIa4TqXI1ojjlAa32+VP/TG X-Received: by 2002:a62:ca0d:: with SMTP id n13-v6mr18783014pfg.69.1532975594587; Mon, 30 Jul 2018 11:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532975594; cv=none; d=google.com; s=arc-20160816; b=NI/8a7jPb8gN6wm9V6EZEvWa/Icy1LEZY1dPKxc2+3xad6xycCJ/29z6aQDOy3krqd /yVTm7eCtDup5NiVqleEsLPttIqOfGaF6PNvCfcJ1KSjh/XgOfaxz7nthXx8IBjVPirc 3LXgWXRpRwyLf/WgcMfftHPivu/Q6kLdsiBBEcfkrLcvb1cb8XNRN1nr+cPZTuzPHFon /cwGU7MHz9QewCNIM9zXxNavE6bScf1Gs455RLoztQmjlKd74g1SkFvkaFUJ9lbyt6Jk X7ewFrOL1Z3W8olMISFE5up8jHy+usEH2q/0d58FeDv9PCAkhiR/21qSg6N1jiNCARfv AeWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:message-id:date:subject:cc:to :from:arc-authentication-results; bh=AHdEeUWWGzjlYRRICwg9/Ip3Yv024o+iaN25w+YUuso=; b=yFR+E6MaaZIxv1lwrmemPq8bK20+NJZtdddpGCopkMeOLH2LSfxdk3p9JuHOSm2rVP e18AZoCdYlBeBDubRqkvqz78KhD1N8zMhQ7vol8LwQ/rPnVI8r5vGCqCz6pFFI8zB0Y9 IoDcinSE38jKAnaQjy0QiTiBIkCIuKMipK1P/pf6s8xXonbiY/67G3gSrs1FXr8hxJvq KxRdUDxyzvLirmfvcsBv8P5SYVuAppZNG2eZtbJjS4xy1Vxq1XCbjrXM6s4RvJSjHZqB 1wpwURvwMxk9T/JYju+hcnzVg0oxw/CcjOatVh2+12VSkwmMgcdI7YQntQwF10i8DCi7 2Rjw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t80-v6si12307116pfk.228.2018.07.30.11.32.47; Mon, 30 Jul 2018 11:33:14 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731597AbeG3UHp (ORCPT + 99 others); Mon, 30 Jul 2018 16:07:45 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:37899 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728965AbeG3UHo (ORCPT ); Mon, 30 Jul 2018 16:07:44 -0400 Received: by mail-qt0-f193.google.com with SMTP id y19-v6so13170643qto.5 for ; Mon, 30 Jul 2018 11:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=AHdEeUWWGzjlYRRICwg9/Ip3Yv024o+iaN25w+YUuso=; b=JW2lxIR6uu/gLvVNAfKlysUCE5Wph1IdGxT752UxdasujwvjdP75ain7rXVQqGdmFm PoW4Etigbe7uoH/wxRmoMOm7O1Y9Arn4ftHlEpXAfTU3N8yeAmqeNrbdfkD49wPS+gW4 bGe8AXC8jYIilgm6tzaVtz1uO/B0466Yfy57VSASNW5DRMJ4zOQ1q8b6aoTIWtJryfIg wzSx05J7lhVqkeJ+KWqJtpv7TIerN/6ny4mpspwcCqNmmh90uIeG8fqqOF57ALsV65o3 KsKVrFBNDWXOAhbDHNOihvD6jdy4gxxv4mqy2sc0UcJ34Xce9eh7Cxd2r+ejN4HXKYuK wmuQ== X-Gm-Message-State: AOUpUlHOK2eaXS0WsE5GbAAbFa2V00UP9OHB+keWRfP5eM3o6KSjBVEa K+RfiNiERaSPSZjpZcFMxpRH6A== X-Received: by 2002:a0c:91b5:: with SMTP id n50-v6mr16213826qvn.90.1532975488398; Mon, 30 Jul 2018 11:31:28 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0]) by smtp.gmail.com with ESMTPSA id q18-v6sm7826570qtg.82.2018.07.30.11.31.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 11:31:27 -0700 (PDT) From: Laura Abbott To: Will Deacon Cc: Laura Abbott , Stephen Rothwell , Kees Cook , Linux-Next Mailing List , Linux Kernel Mailing List , Alexander Popov , Catalin Marinas Subject: [PATCH] efi/libstub: Only disable stackleak plugin for arm64 Date: Mon, 30 Jul 2018 11:31:18 -0700 Message-Id: <20180730183118.25869-1-labbott@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730163722.GD4276@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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