Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4354141ybi; Tue, 11 Jun 2019 05:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqydvJAnBNw5ruUJby8hrG/S3QLcK4ilXdWm9maIYpMZ13/KRV4b//wuLlgX2Q8rOWrJGVRG X-Received: by 2002:a17:902:44f:: with SMTP id 73mr17594778ple.192.1560255853113; Tue, 11 Jun 2019 05:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255853; cv=none; d=google.com; s=arc-20160816; b=fcjUN1OfyzvwCRgLCx+9MeiKrxodRN/l4RE59WROX4nP/VO3YvMba3AGOXdFwsSaXy aT0Ia6ODLHsj7gho/gvfCmbuJRvX/pyU0ht4N794i5IZ7bcTiQsENJd1g7Fvl0PHM4cK lKxJxJHt3XgWyqwQb4bLjJSwg9rFpZFR4pJFPCYLAxQ+KQtXXBpq/ow/ZBrafyWSOa81 CqZwvxt0P+i6oGStN0yAsYMDx1U7NWmmPBNs58sQscAthr5Dl8TUJu+lkkPxQr+qsbFH OXCVVQ3uW5V6Hxgl42QwwOICavxqmTSTT0KatPCu8xezbXdM15fRrQbPxD0hVOQnfHpX aKtA== 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=LkSzo+/iGK0/+BSAGoi+ENvefKKCGrisZxK4DaQ95UA=; b=vzJd3mX66leTr/HtlxqEZflOK79Ap8q04v0X2YfRuJwSzyi5n+ss6BhUEDfWfFoRP1 z1zNfQWCCrRy4ooFa2wP77WnOw+WFRzDoqHzn6oZMcJawzX/3KmLX9yakdhlXDEzgMtY vZzMiZqyCPae8cJtEkKWN8/i+thmETEUCMKUmxmaSjSU09eUHVkXqVLHysAqagSNNDqz u+8rLyvh/woQjLQNbkj0Bxl1IPVBrRgXJwz9pti3JiwwNBD9KIq9YymNrvIoqfTeeTeB JzBfFM33Nrs9WL3Nvhh+MDe1sm87OG8DmnpBwfVyT97e+kTSv80Z7ZzKK3b2TFB+VHdU m1DA== 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 cj16si12760016plb.239.2019.06.11.05.23.58; Tue, 11 Jun 2019 05:24:13 -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 S2403854AbfFKLlS (ORCPT + 99 others); Tue, 11 Jun 2019 07:41:18 -0400 Received: from foss.arm.com ([217.140.110.172]:59198 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403817AbfFKLlS (ORCPT ); Tue, 11 Jun 2019 07:41:18 -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 4F861344; Tue, 11 Jun 2019 04:41:15 -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 1A54D3F557; Tue, 11 Jun 2019 04:42:53 -0700 (PDT) Date: Tue, 11 Jun 2019 12:41:09 +0100 From: Dave Martin To: Florian Weimer Cc: Yu-cheng Yu , 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: <20190611114109.GN28398@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lfy9cq04.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 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. Can we argue that the lack of PT_GNU_PROPERTY is an ABI bug, fix it for new binaries and hence limit the efforts we go to to support theoretical binaries that lack the phdrs entry? If we can make practical simplifications to the parsing, such as limiting the maximum PT_NOTE size that we will search for the program properties to 1K (say), or requiring NT_NOTE_GNU_PROPERTY_TYPE_0 to sit by itself in a single PT_NOTE then that could help minimse the exec overheads and the number of places for bugs to hide in the kernel. What we can do here depends on what the tools currently do and what binaries are out there. Cheers ---Dave