Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1069729ybd; Wed, 26 Jun 2019 10:39:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8bmwiuk4h/Jb0rF/ueghYyTQeOS+k3JJrdMcgkYqF+RdpcUd44DIllMqzvRWtxxPjvuZH X-Received: by 2002:a17:902:9689:: with SMTP id n9mr6880724plp.241.1561570754585; Wed, 26 Jun 2019 10:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561570754; cv=none; d=google.com; s=arc-20160816; b=xnfvInT8lh65+mEBaUN0SnFYRhwRvX5dZV4ZpW62KLGJSCUwuPfP+Ptvi1YQj4ffw0 VV7Lr2oSUgcGwMU88KXD2vj1wHpZ1rpc8nXg4XXspq8LQi2i7U237ukyNNE4Kr+8z8fL DpTIMpmyv0WLiW9el1DBqyAiOCn6e+z81Ek+fHLgHUtVVEZUXokCKd2YyqwQ4sV+6n3D 7yntdX/dQLVqpfHpIMqvm79Hl1QsmTr15ICAfQPy8/JEhOq14ymxlZHSaVTRJx88sCge kxGQ2hn+rzr0XenSXyXBrkkLuFu3aBiSgVfURvwCu+Ky8vYZGVGahQ2au5UH/GAj1DM4 LdqQ== 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=AqyIU3rWQpzA90sPDOX6SRMhi4r1FKCPLmdXup5eYHs=; b=zIP6iJFlDVd0Wxnq9gyJmaJzAM3mBYhuDsf/Zs8aBzTd9V1OY4u9eX5dsy0FqkSJOx dd5dHrfFsk/Kr+e5jFdGz7vqYAfThPAJl13IdKJlYfF34k+XynTaO2lDpU02RvMbcibQ sqfagMHPQm5Xd9nSwZhKrr9h/IOX05ClXoGkaLZfawwBgZpwnfMBgAJGX8Q6dg3jqC9M Tt0MfLEYvko5ZF3qW/dKnSL0O0xf9pGOVEXSmZWEKVbb6ruF6rdD7gQE5QgT8pFe3jrz gLZjRObKvOHaGAoB6GaQL5doTP5DMz442diGArPZyA/ku/NdY3x6AkRYR2DQ49BOsp9r E0yg== 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 y12si16698969pgr.329.2019.06.26.10.38.57; Wed, 26 Jun 2019 10:39:14 -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 S1726381AbfFZRir (ORCPT + 99 others); Wed, 26 Jun 2019 13:38:47 -0400 Received: from mga12.intel.com ([192.55.52.136]:18810 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfFZRir (ORCPT ); Wed, 26 Jun 2019 13:38:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 10:38:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,420,1557212400"; d="scan'208";a="183217012" Received: from yyu32-desk1.sc.intel.com ([10.144.153.205]) by fmsmga001.fm.intel.com with ESMTP; 26 Jun 2019 10:38:46 -0700 Message-ID: <9f7787e255ef859a39ea87e70132a50572f4db65.camel@intel.com> Subject: Re: [PATCH] binfmt_elf: Extract .note.gnu.property from an ELF file From: Yu-cheng Yu To: Andy Lutomirski , Dave Martin Cc: X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "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 , Szabolcs Nagy , libc-alpha Date: Wed, 26 Jun 2019 10:30:24 -0700 In-Reply-To: References: <20190501211217.5039-1-yu-cheng.yu@intel.com> <20190502111003.GO3567@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-26 at 10:14 -0700, Andy Lutomirski wrote: > On Thu, May 2, 2019 at 4:10 AM Dave Martin wrote: > > > > On Wed, May 01, 2019 at 02:12:17PM -0700, Yu-cheng Yu wrote: > > > An ELF file's .note.gnu.property indicates features the executable file > > > can support. For example, the property GNU_PROPERTY_X86_FEATURE_1_AND > > > indicates the file supports GNU_PROPERTY_X86_FEATURE_1_IBT and/or > > > GNU_PROPERTY_X86_FEATURE_1_SHSTK. > > > [...] > > Where did PT_GNU_PROPERTY come from? Are there actual docs for it? > Can someone here tell us what the actual semantics of this new ELF > thingy are? From some searching, it seems like it's kind of an ELF > note but kind of not. An actual description would be fantastic. > > Also, I don't think there's any actual requirement that the upstream > kernel recognize existing CET-enabled RHEL 8 binaries as being > CET-enabled. I tend to think that RHEL 8 jumped the gun here. While > the upstream kernel should make some reasonble effort to make sure > that RHEL 8 binaries will continue to run, I don't see why we need to > go out of our way to keep the full set of mitigations available for > binaries that were developed against a non-upstream kernel. > > In fact, if we handle the legacy bitmap differently from RHEL 8, we > may *have* to make sure that we don't recognize existing RHEL 8 > binaries as CET-enabled. We have worked out the issue. Linux will look at only PT_GNU_PROPERTY, which is a shortcut pointing directly to .note.gnu.property. I have an updated patch, and will send it out (although it is not yet perfect). The Linux gABI extension draft is here: https://github.com/hjl-tools/linux-abi/w iki/linux-abi-draft.pdf. Yu-cheng