Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6003687ybi; Wed, 12 Jun 2019 12:12:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzyWTeCrp0ibxYf7HbG3WVmCJOzbxFCaq5vPnr4iqATNArNJqUS+VgDC8fc1Wk+qW/hvU/ X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr82624240plg.190.1560366765340; Wed, 12 Jun 2019 12:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560366765; cv=none; d=google.com; s=arc-20160816; b=UnNbsMV9lTxN+9Q1j2evjA4H0TALwmWoidxGCfHpJjI3R3YmybPyojaDurDUroI6BE s0at8S8iPYQ41JMQvQGoLKX2aVcFbJfyrfW6jc+5HNYcAnj9B2GujLkEg/CdlTz5uRBA kY61FBeviyAcM3FIRBsMCF1livMGCfKKf0eCpuR+0tVP/sJgT/CfhNxNYAQI84qD6bHe f+j388d+pB3FpKvxIXd26y1KjiuCSu6ruSPg0JHs2QvO/bJJ1bEj11uQU1xUjw0UFbyc FCaAiydgmqQxRY7LNXWFF17zD6OoiXRr0UZSHQX9GHMpFEVW8f91wICQixVvL3MJQ0MR +ohA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=s00AAfCzMqnvlZ7R2AV8WRUEjG3KLNo+EF1uxi9WrvY=; b=CJE36ce/dUQEP2QJbynTIOBMm1zq2oGbW+3LBW0aSn3TjujdMphRNSmlFwiT3fIrqJ ANie+aGixxc6yWOC+NU5RCOSB5fVMYkCnxcqF1iGePPYX1jfDXtDKqd8F/Mc72KFB1yU +d5WDX4VDV+hH5IXLcYW0kucNJTzzSjgHu3xZUP+ZOpDMAoZZZVfSanl/8YvZ6IH0HV2 TFmPNqOsErnti+YKPkgrPNSFo5I6LEn3ZCV27BOQuusK7ThzsWNVXw6t/4zBbKOTSWD4 H+VVuz3auypgGbap+4OnkUKnHc/cAokq5VWipkf9mXNj1v9pqHxqJBlXQEOkX5Qf7pYi TgrA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si570389pgb.180.2019.06.12.12.12.30; Wed, 12 Jun 2019 12:12:45 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbfFLTMD (ORCPT + 99 others); Wed, 12 Jun 2019 15:12:03 -0400 Received: from mga07.intel.com ([134.134.136.100]:25328 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbfFLTMD (ORCPT ); Wed, 12 Jun 2019 15:12:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 12:12:02 -0700 X-ExtLoop1: 1 Received: from yyu32-desk1.sc.intel.com ([10.144.153.205]) by orsmga005.jf.intel.com with ESMTP; 12 Jun 2019 12:12:00 -0700 Message-ID: Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file From: Yu-cheng Yu To: Dave Martin 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 Date: Wed, 12 Jun 2019 12:04:01 -0700 In-Reply-To: <20190612093238.GQ28398@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Yu-cheng