Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3994255ybi; Tue, 18 Jun 2019 09:52:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzplE/c5uJal1dXTWpjocWqEyxpP+Xa858GRSadt2Sd6fAbWMsOC4JW6hI/yi1zcdOirpsu X-Received: by 2002:a17:90a:9a83:: with SMTP id e3mr6012792pjp.105.1560876722206; Tue, 18 Jun 2019 09:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560876722; cv=none; d=google.com; s=arc-20160816; b=tDL8+uPflN8g/3OiXQOxQ9QI8wf/B4yUaP2OG+Gdb+rvYa4cGARXBBpR3a7bzaHDyd SMP5kQVJ81pBM1/VQ/k6LXl7Q8u0iMXrneYZLPvlKIxK2Bq+XLtI4JP1DRcUwCcFKwoo jrxTBtmxntf7Wbx1SH+yZxoFN6h6KD3xSV6IeQBpqmlmBXG+0lbpSJEf9NIFSgJDb+EC BrVgAw0T8nK+zBwNq3v1XHgdk5T6Pjn/RHxAEn7eqAoUoYc2H/VtGQvmP52FQRLdkHS0 a3UAwxkeYcBi4z1Mgz4cDLqhCfC+0OYbYaWAfjgOaJFmVEMXgUiUeQN3Jj6YSXSg/pai gCpQ== 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=cbCOm89CaR3G1j2HEC6TT5+yxrz1x0OCp6qaI06DO8k=; b=VcaFVsb21bx0eeCuRFEjJfT0w+Iho4eiPXNZQX0ExdrfjvdlUro1958jMx8Pt7l9CV oDzZXyLyjjqfT/p3cFd3UYKrMiZtM0Gy0VsTpUJ+ahel3xhsagxrhgFigC420YrIRJrE ThCIeOBzwxMjNE/w+yYpRJnUMsIXR3jYFHvhRA7I1r8Q2UufHLV8FdcEf4eG2PcEEJEk Dtpt3UnfAgFJ4Gr0aXt+2KJksnjv5EPVBNYzuniRnq5mIacmqQ91hd2NUQIJG/aPwhlA CJSmOxxJXnBVQTiC9ZBzuBlBEy0dK/Xw02raE2tysGrh8//jTuLKCxYXiVHgeOhxi3kc fHUw== 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 f9si14139869pfd.110.2019.06.18.09.51.46; Tue, 18 Jun 2019 09:52:02 -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 S1730056AbfFRQuf (ORCPT + 99 others); Tue, 18 Jun 2019 12:50:35 -0400 Received: from foss.arm.com ([217.140.110.172]:50042 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbfFRQuf (ORCPT ); Tue, 18 Jun 2019 12:50:35 -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 E2F57344; Tue, 18 Jun 2019 09:50:33 -0700 (PDT) Received: from e103592.cambridge.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 56B6C3F246; Tue, 18 Jun 2019 09:50:30 -0700 (PDT) Date: Tue, 18 Jun 2019 17:50:28 +0100 From: Dave Martin To: Florian Weimer Cc: Yu-cheng Yu , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, "H. Peter Anvin" , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file Message-ID: <20190618165027.GG2790@e103592.cambridge.arm.com> References: <87ef3r9i2j.fsf@oldenburg2.str.redhat.com> <20190618125512.GJ3419@hirez.programming.kicks-ass.net> <20190618133223.GD2790@e103592.cambridge.arm.com> <87pnna7v1d.fsf@oldenburg2.str.redhat.com> <1ca57aaae8a2121731f2dcb1a137b92eed39a0d2.camel@intel.com> <87blyu7ubf.fsf@oldenburg2.str.redhat.com> <20190618162005.GF2790@e103592.cambridge.arm.com> <8736k67tdc.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8736k67tdc.fsf@oldenburg2.str.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 Tue, Jun 18, 2019 at 06:25:51PM +0200, Florian Weimer wrote: > * Dave Martin: > > > On Tue, Jun 18, 2019 at 09:00:35AM -0700, Yu-cheng Yu wrote: > >> On Tue, 2019-06-18 at 18:05 +0200, Florian Weimer wrote: > >> > * Yu-cheng Yu: > >> > > >> > > > I assumed that it would also parse the main executable and make > >> > > > adjustments based on that. > >> > > > >> > > Yes, Linux also looks at the main executable's header, but not its > >> > > NT_GNU_PROPERTY_TYPE_0 if there is a loader. > >> > > > >> > > > > >> > > > ld.so can certainly provide whatever the kernel needs. We need to tweak > >> > > > the existing loader anyway. > >> > > > > >> > > > No valid statically-linked binaries exist today, so this is not a > >> > > > consideration at this point. > >> > > > >> > > So from kernel, we look at only PT_GNU_PROPERTY? > >> > > >> > If you don't parse notes/segments in the executable for CET, then yes. > >> > We can put PT_GNU_PROPERTY into the loader. > >> > >> Thanks! > > > > Would this require the kernel and ld.so to be updated in a particular > > order to avoid breakage? I don't know enough about RHEL to know how > > controversial that might be. > > There is no official ld.so that will work with the current userspace > interface (in this patch submission). Upstream glibc needs to be > updated anyway, so yet another change isn't much of an issue. This is > not a problem; we knew that something like this might happen. > > Sure, people need a new binutils with backports for PT_GNU_PROPERTY, but > given that only very few people will build CET binaries with older > binutils, I think that's not a real issue either. OK, just wanted to check we weren't missing any requirement for x86. This approach should satisfy the requirement for arm64 nicely. Cheers ---Dave