From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8D5CC433DF for ; Wed, 24 Jun 2020 03:33:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B01AA20767 for ; Wed, 24 Jun 2020 03:33:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vhSG1KJ6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="MvLV62bG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B01AA20767 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uD9cbcpk8EIOywSsAx7vsGCJimwpe3R37sFHUdsj0RE=; b=vhSG1KJ627SiXYqCwIHxo1N2M 1J7pUsBb0caq6njhHXQbO4bIEg1NUpEEaqjpjaG18cw0Z7yBErHCrTf0B2zGPXIRNuaTESgO9mPe3 YqobJjYkwhEKuU+Me2l/mpnQU2DfGlKjD0CHGvPAfIm9XgjVc8E74Kcse4iDenOPoSip0qVbDOh+h KLX9MfRhHfZ6qeWqiPbj0qxzx39Fz8w3JNIuxMsHBh3I+h5vDR7p58fE21BfS+zihNxQ+UgEmxe8o RaxSv56Vr4jbpibzJaGicQxAIlkqHy6dXv5k6KMAttWnQydkZrLDQh1evCf9azDiR87Ck2GFKE4VQ WH+6S0rMg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnw8f-0005f4-9u; Wed, 24 Jun 2020 03:31:53 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnw8b-0005cu-Us for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 03:31:50 +0000 Received: by mail-pj1-x1042.google.com with SMTP id d6so498694pjs.3 for ; Tue, 23 Jun 2020 20:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IahJt8/KJJjCX5znAGwjVoLhoLAi5KgGttIopC9m27U=; b=MvLV62bGP7HuCujPeBIHKz13XUI8YQmFtRra1vib+8tF+xHHQRVE/n3L2rgdukvz0W tXgg5gRG56BP2uOmEc+oEMf47b4I2KLwUM3lCVukC+NRxgYxHqsxLKDUjSfA6R0sfqEo TgggLZp03MNbl6iiR1g9B+Tdp9CA3YajVJsQpkFoRyIFXvFULZrBVh7rUaJHmg4R6nNH 1qsvb5gRGuCH3ZPUtMEqqFW/A+OofiC/qMD5DJlvOz7Ilyyt2ZStv6KM1sJPos9n372w 0UbUY406dJ7GN3qOL01soPCDMdymvlW2KSQp3fukKyBl3YvdOFBaJIjT8ZDn4ePN1mFb xD6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IahJt8/KJJjCX5znAGwjVoLhoLAi5KgGttIopC9m27U=; b=ZhVtWnvcS7u9natp5P0vXZhIEdZD06lyMRLUSLMU0Rkkk62xGKQUhSeGYntaANx2fY oaLen4ZopUEnry5vM/SCPvJeGBuicshwF2aGe0KAOFSauNSeqbXBgg5HEIswLyoM38x4 c6nX0XOegBQsmmAXwIQJGUfeCTNswlOvzKcVMbWpt+vkMb+GtVbl7kQORz0+r+gp5mBt 0MFz6hfuCg5liWVFrpIojsYb2sAgrI0Ke3Mm+ngdAaSVjGrwtY+28kceMTfqr0KcfdY8 N+Wcn0mQrmNuBahTIZNn/D7CyncEG7sKR9XLRB9lNgOiPS3QqRUbt54+sneE6QJlFIeZ lyiA== X-Gm-Message-State: AOAM530F9EHUR8Yw7VBqNyWG50XYsF2EtXwl2Ymr0m7CDMI3H7LEjWu+ +qEm1IiimVKaci0fN260kdDuVg== X-Google-Smtp-Source: ABdhPJwO/hYz95xUwT1OWmJI4vtUw4+LYaBqYL3FPsRivwPfG7ygEmvTnhPAC6hvl2WpJppN7B6bFQ== X-Received: by 2002:a17:90a:1ac3:: with SMTP id p61mr27689014pjp.23.1592969505744; Tue, 23 Jun 2020 20:31:45 -0700 (PDT) Received: from google.com ([2620:15c:2ce:0:9efe:9f1:9267:2b27]) by smtp.gmail.com with ESMTPSA id c2sm14702791pgk.77.2020.06.23.20.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 20:31:45 -0700 (PDT) Date: Tue, 23 Jun 2020 20:31:42 -0700 From: Fangrui Song To: Kees Cook Subject: Re: [PATCH v3 3/9] efi/libstub: Remove .note.gnu.property Message-ID: <20200624033142.cinvg6rbg252j46d@google.com> References: <20200624014940.1204448-1-keescook@chromium.org> <20200624014940.1204448-4-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624014940.1204448-4-keescook@chromium.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, Arnd Bergmann , Peter Collingbourne , Catalin Marinas , Masahiro Yamada , x86@kernel.org, Nick Desaulniers , Russell King , linux-kernel@vger.kernel.org, Nathan Chancellor , clang-built-linux@googlegroups.com, Arvind Sankar , Ingo Molnar , James Morse , Thomas Gleixner , Borislav Petkov , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-06-23, Kees Cook wrote: >In preparation for adding --orphan-handling=warn to more architectures, >make sure unwanted sections don't end up appearing under the .init >section prefix that libstub adds to itself during objcopy. > >Signed-off-by: Kees Cook >--- > drivers/firmware/efi/libstub/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile >index 75daaf20374e..9d2d2e784bca 100644 >--- a/drivers/firmware/efi/libstub/Makefile >+++ b/drivers/firmware/efi/libstub/Makefile >@@ -66,6 +66,9 @@ lib-$(CONFIG_X86) += x86-stub.o > CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) > CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) > >+# Remove unwanted sections first. >+STUBCOPY_FLAGS-y += --remove-section=.note.gnu.property >+ > # > # For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the > # .bss section, so the .bss section of the EFI stub needs to be included in the arch/arm64/Kconfig enables ARM64_PTR_AUTH by default. When the config is on ifeq ($(CONFIG_ARM64_BTI_KERNEL),y) branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI) := -mbranch-protection=pac-ret+leaf+bti else branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=pac-ret+leaf endif This option creates .note.gnu.property: % readelf -n drivers/firmware/efi/libstub/efi-stub.o Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: AArch64 feature: PAC If .note.gnu.property is not desired in drivers/firmware/efi/libstub, specifying -mbranch-protection=none can override -mbranch-protection=pac-ret+leaf _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel