Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3528235ybi; Tue, 18 Jun 2019 02:13:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKl2YFwBdd3V7EVqySklhDd4wpTJL1ciG2HJrsTWfFNGftZFFK0C8uAqjE2ubqPu9kBSp2 X-Received: by 2002:a63:4104:: with SMTP id o4mr1775700pga.345.1560849200313; Tue, 18 Jun 2019 02:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560849200; cv=none; d=google.com; s=arc-20160816; b=D4IBuKVYANjbfDgSWpEVdRVJRMjr914SpMswkdWMq6pAC0UdwsR88oOu7GipFkOETD WnfbKccF8s12zMbRT+B9wZX48WUiwxwpk5FO+WIgaLcR3EWGtw0YaDC2cUVKav2V4LXk XiegcPOPFdb8UkzEKR2HLgWq06HddiOO5GeNzyk1ASGfEE8FpwxqKLaUO1UubLXlzVvf hLLbpms/JyUA+d7apFF+wa+sQfy7eXwf/gcCoJkGHSSqe3xHn9w9mHqB66cWj+mBK1TO KxSMajd+3wUErwHaMPXLc76lQzGDHI8pp0b+c4NDysivy3K1pZHBalc50XwHdbZSBRq2 vvsw== 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=B5unngtNz5I4UQ27+8Qxx0YTxNw7SawuVoye9McdKBg=; b=emwpUMOVMPW1PSCwZlaGU6IaNLQF2B8YVoNM/aB4lxMUFWfSydbAxSHxtmVhqB//5n k8BWLZBAvYi5YOTXRHp+tRmANCxtMjuDveIr+tzLUKAAOpbm6Yu2OaABSFZwpRaiPIcJ M7aHFRx7ekSr5DlUy5y9EBuMfjH2HgX0FYxDraIbywIL3L/+gFVEh6PDTMQd6EXgnEe9 99MNm9wzg8sTB+I5zrNMM7LywzG+sZ9f4CRDnTj3Qn5bojpdX3II46UddhG5CfBdPA15 G2IQ7jGztUuR2IpKpmM6UcEbwYjesYg9fqTVOfHI6jdBBvGpQUpUXa9ATImfwIXvHjXX i3Vg== 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 h187si13126512pfb.129.2019.06.18.02.13.00; Tue, 18 Jun 2019 02:13:20 -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 S1729229AbfFRJM5 (ORCPT + 99 others); Tue, 18 Jun 2019 05:12:57 -0400 Received: from foss.arm.com ([217.140.110.172]:58496 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbfFRJM4 (ORCPT ); Tue, 18 Jun 2019 05:12:56 -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 0D7DD344; Tue, 18 Jun 2019 02:12:56 -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 6F3EB3F246; Tue, 18 Jun 2019 02:12:52 -0700 (PDT) Date: Tue, 18 Jun 2019 10:12:50 +0100 From: Dave Martin To: Thomas Gleixner Cc: 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 , 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: <20190618091248.GB2790@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> <87imt4jwpt.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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'd still favour a Kconfig option to allow this support to be suppressed by arches that don't have a similar legacy to be compatible with. Cheers ---Dave