From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB85AC31E51 for ; Tue, 18 Jun 2019 12:42:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9F2720679 for ; Tue, 18 Jun 2019 12:42:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dUWu615y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727964AbfFRMl7 (ORCPT ); Tue, 18 Jun 2019 08:41:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46610 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfFRMl7 (ORCPT ); Tue, 18 Jun 2019 08:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tU+uoH636LnLs6tWofoR44x7rXbC9eLZS1/AxRoae2A=; b=dUWu615yd4Eq0frSeVJMzBQnr c7NZoCsnZO11ofhGx28MfjNFgfdgnq+WNL46xVo1bkwml4T7hWh1kog4kNWUyrbd75WdvkK7nZmlH J54e4GW7oZGuunIRilDjhExoD/2oYz/DadDxTnEu4uU7iPv+gZNirnpq1VXc8bgoCxhxmpnNSt96x z4GHkSRBLpcc4tRATSGSTlAkXuJJVcLR0OV1zeyBLu9QDskQswnG7ZKZg07d+Xd3D5el6+FGgGOvz dla09z4BqHqHrFOoAq5S+/i++Fi390VrVCyimBkasZRwofWz+sZ0y7uEmCfgeodjXhMJN9SKCvJlx FXmFJ4xdg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hdDQR-0007Pf-Bh; Tue, 18 Jun 2019 12:41:23 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 22F1F209C88F8; Tue, 18 Jun 2019 14:41:22 +0200 (CEST) Date: Tue, 18 Jun 2019 14:41:22 +0200 From: Peter Zijlstra To: Dave Martin Cc: Thomas Gleixner , Florian Weimer , Yu-cheng Yu , 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: <20190618124122.GH3419@hirez.programming.kicks-ass.net> References: <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> <87imt4jwpt.fsf@oldenburg2.str.redhat.com> <20190618091248.GB2790@e103592.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618091248.GB2790@e103592.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 10:12:50AM +0100, Dave Martin wrote: > On Mon, Jun 17, 2019 at 02:20:40PM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jun 2019, Florian Weimer wrote: > > > * Dave Martin: > > > > On Tue, Jun 11, 2019 at 12:31:34PM -0700, Yu-cheng Yu wrote: > > > >> 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? > > > > > > I'm worried that this causes interop issues similarly to what we see > > > with VSYSCALL today. If we need both and a way to disable it, it should > > > be something like a personality flag which can be configured for each > > > process tree separately. Ideally, we'd settle on one correct approach > > > (i.e., either always process both, or only process PT_GNU_PROPERTY) and > > > enforce that. > > > > Chose one and only the one which makes technically sense and is not some > > horrible vehicle. > > > > Everytime we did those 'oh we need to make x fly workarounds' we regretted > > it sooner than later. > > So I guess that points to keeping PT_NOTE scanning always available as a > fallback on x86. This sucks a bit, but if there are binaries already in > the wild that rely on this, I don't think we have much choice... I'm not sure I read Thomas' comment like that. In my reading keeping the PT_NOTE fallback is exactly one of those 'fly workarounds'. By not supporting PT_NOTE only the 'fine' people already shit^Hpping this out of tree are affected, and we don't have to care about them at all. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file Date: Tue, 18 Jun 2019 14:41:22 +0200 Message-ID: <20190618124122.GH3419@hirez.programming.kicks-ass.net> References: <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> <87imt4jwpt.fsf@oldenburg2.str.redhat.com> <20190618091248.GB2790@e103592.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190618091248.GB2790@e103592.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org To: Dave Martin Cc: Thomas Gleixner , Florian Weimer , Yu-cheng Yu , 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 , N List-Id: linux-api@vger.kernel.org On Tue, Jun 18, 2019 at 10:12:50AM +0100, Dave Martin wrote: > On Mon, Jun 17, 2019 at 02:20:40PM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jun 2019, Florian Weimer wrote: > > > * Dave Martin: > > > > On Tue, Jun 11, 2019 at 12:31:34PM -0700, Yu-cheng Yu wrote: > > > >> 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? > > > > > > I'm worried that this causes interop issues similarly to what we see > > > with VSYSCALL today. If we need both and a way to disable it, it should > > > be something like a personality flag which can be configured for each > > > process tree separately. Ideally, we'd settle on one correct approach > > > (i.e., either always process both, or only process PT_GNU_PROPERTY) and > > > enforce that. > > > > Chose one and only the one which makes technically sense and is not some > > horrible vehicle. > > > > Everytime we did those 'oh we need to make x fly workarounds' we regretted > > it sooner than later. > > So I guess that points to keeping PT_NOTE scanning always available as a > fallback on x86. This sucks a bit, but if there are binaries already in > the wild that rely on this, I don't think we have much choice... I'm not sure I read Thomas' comment like that. In my reading keeping the PT_NOTE fallback is exactly one of those 'fly workarounds'. By not supporting PT_NOTE only the 'fine' people already shit^Hpping this out of tree are affected, and we don't have to care about them at all.