Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp717538ybt; Wed, 24 Jun 2020 09:30:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQO9JX8oQsO7OBLcXx4juQZ7YgRpzB+1GPp3h1n5WeZyMgINb4LHIG2cmbUNRZKs2y5+4t X-Received: by 2002:a50:b8e3:: with SMTP id l90mr17355471ede.172.1593016202661; Wed, 24 Jun 2020 09:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593016202; cv=none; d=google.com; s=arc-20160816; b=PyDzgqjePZ6X6TzG1uzl/dQnCqS9BE5vXoLA/yeDbq1Ad59FKejEJ4vcxjb5lLZ0W4 gW9i8Cof9qUT6qY1Td1MLIm9OIEhu8kVATuTgX9J7RcPxI///mjjI8eg78vQlzRR0uEI A+ju02uODjUj8OoDrRXtVfj+Iuv2AUrtpOd2UZVHzIpEyWOkp8QWf0Ep+L1NlgyyW4EL 98nU5kk0PG8J5MXF/g4BlQmNtoa0kmLHxpLmOqXU2yPluZv6KrG/+CQSYm/f6aFSgYfm k5vSEUGK8bYp6hXBAcGntrMCQXCn4LulUBG1aeLJ23+uL/A1maG7KgwF1FFjZR5ZHg/N frZQ== 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; bh=54mDaFl7jSktbShlWhhAEfiGyAxRgqqWufjgJR1AMQ4=; b=G0iChq3qpQBjIVQgpxJLZIHKBCICY14fWYnxpt5EMRsyKzhiCNpDon/MMw37uP8dca dQEtHbQNrqpVg1Z98erH5rhAwKJ9QqM6NLdkymcOjHftb1HYUcHCFcybTHpnn8ncuXQ0 Pqg7ld9fQHbAffAwhOxfJEe2x6dQ+NdwLe1INd3BsJA1Agif6gLzsNY7EGS9EwR3n//v w4kqgG/LFNwsqzSWfCvNDcFWEuWahkisPgXbstFsNfhY9bvvLszmd2lVWHkGdHcVDDxu txB8nrIrloSXJhj/JT4zuWzo2ijZ+CVtvYUycKp+W/mAgAlkmJOlCGZN2PW4oH7QebP2 3mOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si13189180ejs.458.2020.06.24.09.29.38; Wed, 24 Jun 2020 09:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404745AbgFXQ1E (ORCPT + 99 others); Wed, 24 Jun 2020 12:27:04 -0400 Received: from foss.arm.com ([217.140.110.172]:40466 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404691AbgFXQ1D (ORCPT ); Wed, 24 Jun 2020 12:27:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D02891FB; Wed, 24 Jun 2020 09:27:02 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A0A93F73C; Wed, 24 Jun 2020 09:26:59 -0700 (PDT) Date: Wed, 24 Jun 2020 17:26:58 +0100 From: Dave Martin To: Will Deacon Cc: Mark Rutland , linux-efi , Catalin Marinas , Arvind Sankar , Thomas Gleixner , linux-arch , Fangrui Song , Masahiro Yamada , X86 ML , Russell King , Ard Biesheuvel , clang-built-linux , Ingo Molnar , Borislav Petkov , Kees Cook , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , Linux ARM , Nick Desaulniers , Linux Kernel Mailing List , James Morse Subject: Re: [PATCH v3 3/9] efi/libstub: Remove .note.gnu.property Message-ID: <20200624162657.GG25945@arm.com> References: <20200624014940.1204448-1-keescook@chromium.org> <20200624014940.1204448-4-keescook@chromium.org> <20200624033142.cinvg6rbg252j46d@google.com> <202006232143.66828CD3@keescook> <20200624104356.GA6134@willie-the-truck> <20200624112647.GC6134@willie-the-truck> <20200624134854.GF25945@arm.com> <20200624152646.GA6768@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624152646.GA6768@willie-the-truck> 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 Wed, Jun 24, 2020 at 04:26:46PM +0100, Will Deacon wrote: > On Wed, Jun 24, 2020 at 02:48:55PM +0100, Dave Martin wrote: > > On Wed, Jun 24, 2020 at 12:26:47PM +0100, Will Deacon wrote: > > > On Wed, Jun 24, 2020 at 12:46:32PM +0200, Ard Biesheuvel wrote: > > > > On Wed, 24 Jun 2020 at 12:44, Will Deacon wrote: > > > > > For the kernel Image, how do we remove these sections? The objcopy flags > > > > > in arch/arm64/boot/Makefile look both insufficient and out of date. My > > > > > vmlinux ends up with both a ".notes" and a ".init.note.gnu.property" > > > > > segment. > > > > > > > > The latter is the fault of the libstub make rules, that prepend .init > > > > to all section names. > > > > > > Hmm. I tried adding -mbranch-protection=none to arm64 cflags for the stub, > > > but I still see this note in vmlinux. It looks like it comes in via the > > > stub copy of lib-ctype.o, but I don't know why that would force the > > > note. The cflags look ok to me [1] and I confirmed that the note is > > > being generated by the compiler. > > > > > > > I'm not sure if there is a point to having PAC and/or BTI in the EFI > > > > stub, given that it runs under the control of the firmware, with its > > > > memory mappings and PAC configuration etc. > > > > > > Agreed, I just can't figure out how to get rid of the note. > > > > Because this section is generated by the linker itself I think you might > > have to send it to /DISCARD/ in the link, or strip it explicitly after > > linking. > > Right, but why is the linker generating that section in the first place? I'm > compiling with -mbranch-protection=none and all the other objects linked > into the stub do not have the section. > > I wonder if it's because lib/ctype.c doesn't have any executable code... What compiler and flags are you using for the affected object? I don't see this with gcc so far. I wonder if this is a hole in the specs: the property could logically be emitted in any codeless object, since turning on BTI will obviously not break that object. For different linkers and compilers to interoperate though, the specs would need to say what to do in that situation. Cheers ---Dave > > Will > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel