Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3728188ybi; Tue, 18 Jun 2019 05:42:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqygAFoe8Q+dVVNIO+ixlQhEbo1tI+wTmRct5VHU7vrC0dUvB5OQL/ooYBYGIIwUp/GexFNn X-Received: by 2002:a17:902:758e:: with SMTP id j14mr985336pll.250.1560861749692; Tue, 18 Jun 2019 05:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560861749; cv=none; d=google.com; s=arc-20160816; b=pHzkITVOWPg+1R5Olr7/zSg2lN7lSROWXnyu6M5s+nCvHPmzIoa/hBHRXmMMjW/jdi DiHRuyFuimD8ojx9GyTwcaz0zDsXmqnzxSRrhg7F9J6q8WYL1ZfsYjNtWTiNNs5mLg2K GnY3+wBHIW/eRNPPcVrI42b86JqzY0abX9oMUqjeBlVnlRK0RkEYVaD4/q/9UxUSFzDQ lJp7zL2JqWYZ6P2W8o2CAEftYBOEccEPBshHuLuSGE5WIWCgdBkPwQKAVgKwItl5r2F4 y9UCyzb2NJzOyZDSyy4yviSKvGg1h9IhL830egzOVGMVz2mszXCC4vi7mSCdZDXlXQGe TeSw== 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:dkim-signature; bh=tU+uoH636LnLs6tWofoR44x7rXbC9eLZS1/AxRoae2A=; b=WnpAcWt4ox95Kp+WKPRmG+p+Ox/Jymxwu1a4hkZG35x5JQm3DwN792COsswvZ+E/VM IUCTKgFOSA8vSxGgNDN+p4edGX3IWumtdsA3v8xTJxzAqrTl80aidhSRyj1wdzohbnDe u8+4xyEh3MVB2HQnXM4YH7oFp26/+khWKUIV95tbQYgpp5MAQ/7xkOdnOKWKVqSESExE FqZEi58P/rwRGymivCYuU6ODmQgf6il+NZpJoGxeHROS8YrndY5zqC++HhmA2tBOhNuN xLaI1d+7k9dbEp0eO+gAzb7lXC97YTZd8BQ1f4jpTHDfWDOAbv13BkW3unZ3C15zlAS3 q/+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dUWu615y; 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 a24si1635531pju.32.2019.06.18.05.42.13; Tue, 18 Jun 2019 05:42:29 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dUWu615y; 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 S1726543AbfFRMl7 (ORCPT + 99 others); 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.