Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3953205ybi; Tue, 18 Jun 2019 09:09:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ8BQhl6LopEvKdVT2z7RBBZVtjC57GJFkTV4EfRMvX0nrYm+ISr07euE/F0Ls0oSYEx7N X-Received: by 2002:a17:90a:2430:: with SMTP id h45mr6200634pje.14.1560874148589; Tue, 18 Jun 2019 09:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560874148; cv=none; d=google.com; s=arc-20160816; b=tcsBLhhDMbCbH2EfnBA48XLGEuob1Xn8Ot0RvpwIDnsQd8Ng7Ax1fcrlEhZ9bVwlw/ thSWSDLwvRfZnaaGpdbdQVxyDEER35TeMvalTtoseUfsxWokrkaKU5hdNwvdFF62/tAn yewtcdFccITnEBB6j34fuoALbzY08Vnz8GJNE2XKguU8Ut9AKtTkmwAhWbIUyRqRx5sM ypbnrWcu/qkQ70qw0MWIJHQG/nS7FJVZxfTFW4IufSWzjaEeLCmmJKa0T0z6v6SwSNdc UCAlshZwSxGXAxtqNh5Icc0D/Qn7kY6Y4b452oevxv5NT+qjQLkPfL7dRwj0V2jDEdcL lt+g== 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=jUSJcSZPRnDk19Up/Q/AWhAgTjKe0JdfO9K1j5BKlfU=; b=jdMXlwH8xbAPViIU0Y21gURGhyD1dVC2oMYlVBQJ1Fp5w7qAN0QoMWVycg4FtYlBU9 8lRS4NrVfyl+fGar5KwA76PMqckROe6oG1xg9HNYwydgZgpEJfMY6AsREJI6iIA0lEEp hk5lJ4uek9UYMoCIvho3jBTP+Xvdgl+fyBpNsiba9FhaaC8z9UyS+EQDW38QC0dELccg pKQHzf9JeXv8OYTDVrY1NnUYxjpHIy/231p4Ro8A0ECRhde4YVIJhkagSbspPaU97spZ Cq0G3L4Pvr7XVrkRA5sqUJXECQ2i5g8biHP6TKY8WDR++0SltZso4abOkUQ8dtmryMEv LJGw== 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 i5si2582923pjk.57.2019.06.18.09.08.52; Tue, 18 Jun 2019 09:09:08 -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 S1729830AbfFRQIp (ORCPT + 99 others); Tue, 18 Jun 2019 12:08:45 -0400 Received: from mga03.intel.com ([134.134.136.65]:12038 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729247AbfFRQIp (ORCPT ); Tue, 18 Jun 2019 12:08:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 09:08:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,389,1557212400"; d="scan'208";a="358310992" Received: from yyu32-desk1.sc.intel.com ([10.144.153.205]) by fmsmga006.fm.intel.com with ESMTP; 18 Jun 2019 09:08:44 -0700 Message-ID: Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file From: Yu-cheng Yu To: Florian Weimer Cc: Dave Martin , Peter Zijlstra , Thomas Gleixner , 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 Date: Tue, 18 Jun 2019 09:00:35 -0700 In-Reply-To: <87blyu7ubf.fsf@oldenburg2.str.redhat.com> References: <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> <20190618124122.GH3419@hirez.programming.kicks-ass.net> <87ef3r9i2j.fsf@oldenburg2.str.redhat.com> <20190618125512.GJ3419@hirez.programming.kicks-ass.net> <20190618133223.GD2790@e103592.cambridge.arm.com> <87pnna7v1d.fsf@oldenburg2.str.redhat.com> <1ca57aaae8a2121731f2dcb1a137b92eed39a0d2.camel@intel.com> <87blyu7ubf.fsf@oldenburg2.str.redhat.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 Tue, 2019-06-18 at 18:05 +0200, Florian Weimer wrote: > * Yu-cheng Yu: > > > > I assumed that it would also parse the main executable and make > > > adjustments based on that. > > > > Yes, Linux also looks at the main executable's header, but not its > > NT_GNU_PROPERTY_TYPE_0 if there is a loader. > > > > > > > > ld.so can certainly provide whatever the kernel needs. We need to tweak > > > the existing loader anyway. > > > > > > No valid statically-linked binaries exist today, so this is not a > > > consideration at this point. > > > > So from kernel, we look at only PT_GNU_PROPERTY? > > If you don't parse notes/segments in the executable for CET, then yes. > We can put PT_GNU_PROPERTY into the loader. Thanks!