Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7022531ybi; Thu, 13 Jun 2019 08:17:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3kt7b/r+v2440LAIJPN7r6F30+5DWW/BeW87IuyFLKti9u58KLpT3zjYKaWTt5XRaT9sQ X-Received: by 2002:a62:ee17:: with SMTP id e23mr96067961pfi.130.1560439045490; Thu, 13 Jun 2019 08:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439045; cv=none; d=google.com; s=arc-20160816; b=z7a++xujJEDPTc9OWICtjywdVpUdSsnSvKQJNHwVWRPPhsslhA+zJOFY09b/tZzVJd ObPFbUaEiNg2N1YbdO9ewCEE9Lzi3czq586qj2VrPtpLaoUo++ys7I+WA1Rm2dOAvaOF MuJ+YxRaUEYQNIicRWL9h3TIhKS44o19e3kiU7u1ak/9i8YC+YdQgOk7ugBozXAwlle+ kRZd6fRclG826YvTX0efdFVS15YeI/t/k/WS9c2k2WrQBd9CftBT2qLh2LqrDbVQTeZl A+F91ZYMpAAfv00OtYXky80CtFSWAyNCx0KyW0geZjJNGVWNeWoj6WLJI0bNn7hg3GBD J+Hw== 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=UNBuwHu5ogeUMBOwYOqLU+Ps9l58XgB4dMd5pLPyQwQ=; b=HITX2mea3vjHnt2ik+QJlhnvvTiPBh6PgHpRhs4rbfq61Si1bfwPrQ8VGMceYj0JMg frU5W0GHq83tURumJFQE5jKaM3uLKOUKpMwjjXXd8mxPyjri/SzhpGjIsxDEMFMDwMqH 71LU2itJTzq6kqRb517m74ZF1PeZFc4ZKP+54w1RSP29CsAYzh0PxGvi4O4Pa2V216p9 FujfCyBpIewglMSuaJyYewoT4Fruq/XDxwwOXFQ+X6H8iSwLO9Qy40dHaZSo7BQ6mS8p 6FOr99Qn0W3MaC5SnB7UIzcI4oZWWGDsD9sgsg6HegwnBXE1/NDb+TbN4NBciyAfeqCp 6G8A== 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 c2si3156477pls.346.2019.06.13.08.17.09; Thu, 13 Jun 2019 08:17:25 -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 S1733091AbfFMPPA (ORCPT + 99 others); Thu, 13 Jun 2019 11:15:00 -0400 Received: from foss.arm.com ([217.140.110.172]:39908 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732241AbfFMN0a (ORCPT ); Thu, 13 Jun 2019 09:26:30 -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 7478D2B; Thu, 13 Jun 2019 06:26:29 -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 DD1273F73C; Thu, 13 Jun 2019 06:26:25 -0700 (PDT) Date: Thu, 13 Jun 2019 14:26:23 +0100 From: Dave Martin To: Yu-cheng Yu Cc: Florian Weimer , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , 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 , Peter Zijlstra , 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: <20190613132623.GA28398@e103592.cambridge.arm.com> References: <20190606200646.3951-1-yu-cheng.yu@intel.com> <20190606200646.3951-23-yu-cheng.yu@intel.com> <20190607180115.GJ28398@e103592.cambridge.arm.com> <94b9c55b3b874825fda485af40ab2a6bc3dad171.camel@intel.com> <87lfy9cq04.fsf@oldenburg2.str.redhat.com> <20190611114109.GN28398@e103592.cambridge.arm.com> <031bc55d8dcdcf4f031e6ff27c33fd52c61d33a5.camel@intel.com> <20190612093238.GQ28398@e103592.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 12, 2019 at 12:04:01PM -0700, Yu-cheng Yu wrote: > On Wed, 2019-06-12 at 10:32 +0100, Dave Martin wrote: > > On Tue, Jun 11, 2019 at 12:31:34PM -0700, Yu-cheng Yu wrote: > > > On Tue, 2019-06-11 at 12:41 +0100, Dave Martin wrote: > > > > On Mon, Jun 10, 2019 at 07:24:43PM +0200, Florian Weimer wrote: > > > > > * Yu-cheng Yu: > > > > > > > > > > > To me, looking at PT_GNU_PROPERTY and not trying to support anything > > > > > > is a > > > > > > logical choice. And it breaks only a limited set of toolchains. > > > > > > > > > > > > I will simplify the parser and leave this patch as-is for anyone who > > > > > > wants > > > > > > to > > > > > > back-port. Are there any objections or concerns? > > > > > > > > > > Red Hat Enterprise Linux 8 does not use PT_GNU_PROPERTY and is probably > > > > > the largest collection of CET-enabled binaries that exists today. > > > > > > > > For clarity, RHEL is actively parsing these properties today? > > > > > > > > > My hope was that we would backport the upstream kernel patches for CET, > > > > > port the glibc dynamic loader to the new kernel interface, and be ready > > > > > to run with CET enabled in principle (except that porting userspace > > > > > libraries such as OpenSSL has not really started upstream, so many > > > > > processes where CET is particularly desirable will still run without > > > > > it). > > > > > > > > > > I'm not sure if it is a good idea to port the legacy support if it's not > > > > > part of the mainline kernel because it comes awfully close to creating > > > > > our own private ABI. > > > > > > > > I guess we can aim to factor things so that PT_NOTE scanning is > > > > available as a fallback on arches for which the absence of > > > > PT_GNU_PROPERTY is not authoritative. > > > > > > We can probably check PT_GNU_PROPERTY first, and fallback (based on ld-linux > > > version?) to PT_NOTE scanning? > > > > For arm64, we can check for PT_GNU_PROPERTY and then give up > > unconditionally. > > > > For x86, we would fall back to PT_NOTE scanning, but this will add a bit > > of cost to binaries that don't have NT_GNU_PROPERTY_TYPE_0. The ld.so > > version doesn't tell you what ELF ABI a given executable conforms to. > > > > Since this sounds like it's largely a distro-specific issue, maybe there > > could be a Kconfig option to turn the fallback PT_NOTE scanning on? > > Yes, I will make it a Kconfig option. OK, that works for me. This would also help keep the PT_NOTE scanning separate from the rest of the code. For arm64 we could then unconditionally select/deselect that option, where x86 could leave it configurable either way. Cheers ---Dave