Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp375084ybi; Fri, 7 Jun 2019 09:27:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs+fCiQ6wPCetbU4s/G8zbW7izo5iv1XERb/W31Te4Xx1pvk7vBZNzNgYEFu6F/fHgzh/R X-Received: by 2002:a17:90a:216c:: with SMTP id a99mr6217484pje.3.1559924834842; Fri, 07 Jun 2019 09:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559924834; cv=none; d=google.com; s=arc-20160816; b=lCCircID05+S7WjMnr1GnoHp6iUXLl55ZdCmWGtovgIeopAvGtk/X+DagyTu5JWXPK lnLmv8kLKaUiPAxt5tAAxKucwXtF3x8J9+nJoOYQyOh1LgN2nsHnKJZ47SVI/hFjKbN3 S2y+s2C6lotjRbeULgMquxjzi1gjRHdRY74ot+3XCbG86ODq/mTsjY1m/IIifiVB/9i4 QHZ93Ut0yAYwMR6NI+Cigq5Y232ndNqaqDElBMTqvx8b5+4H9CNOStAEK8JOR7+1Q0Wp OoThWoQfoHrfJVTnynwS/aWOoSkIOOWLm2ayJGuGiw7fgjwCMb3ET/uiLS7snPAKRLR9 +U5Q== 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=fqZYQrrzFI1K/T5Ovd1jNF/j9A9kDqy2YB6vahLoPIQ=; b=pQq+NSJN46hy50BjbTIncb+cZihNadihxdo0XDorMXM3pyJ7VTKtMrFUAjoAgjjUws sBdZRSXfwalt+mdvFwN1Bkn0E4kIJVM4PomIycraTswXVG7iaNfp7jDa+5FLAZNDVmKj vE2mT3TaruMQtTiudFYmUX70wgs++H6GAC32X9eBweHs8ycBpOEy6U944nW8RmamPJ81 GM1p1IwLhGtTovLpKL8+C/2PPzWETy7Dw1xAqIgiht12yE9B8HkNG5tXZ5h6E/1dQaYc 0n09hm8f4GlS05k64pLSXwNsM6eNyKF7iCnTh1Mhk8/Cdrlp0jditrbkIdacRr9y6fkQ CHig== 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 w65si1213471pgw.6.2019.06.07.09.26.58; Fri, 07 Jun 2019 09:27:14 -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 S1730786AbfFGQZK (ORCPT + 99 others); Fri, 7 Jun 2019 12:25:10 -0400 Received: from mga09.intel.com ([134.134.136.24]:13437 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730634AbfFGQZJ (ORCPT ); Fri, 7 Jun 2019 12:25:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 09:25:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,563,1557212400"; d="scan'208";a="182720042" Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by fmsmga002.fm.intel.com with ESMTP; 07 Jun 2019 09:25:08 -0700 Message-ID: <1b5778f8f1336ad7a63f4621f189b7f04a56a9ed.camel@intel.com> Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file From: Yu-cheng Yu To: Peter Zijlstra Cc: 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 , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Date: Fri, 07 Jun 2019 09:17:06 -0700 In-Reply-To: <20190607075822.GR3419@hirez.programming.kicks-ass.net> References: <20190606200646.3951-1-yu-cheng.yu@intel.com> <20190606200646.3951-23-yu-cheng.yu@intel.com> <20190607075822.GR3419@hirez.programming.kicks-ass.net> 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 Fri, 2019-06-07 at 09:58 +0200, Peter Zijlstra wrote: > On Thu, Jun 06, 2019 at 01:06:41PM -0700, Yu-cheng Yu wrote: > > An ELF file's .note.gnu.property indicates features the executable file > > can support. For example, the property GNU_PROPERTY_X86_FEATURE_1_AND > > indicates the file supports GNU_PROPERTY_X86_FEATURE_1_IBT and/or > > GNU_PROPERTY_X86_FEATURE_1_SHSTK. > > > > With this patch, if an arch needs to setup features from ELF properties, > > it needs CONFIG_ARCH_USE_GNU_PROPERTY to be set, and a specific > > arch_setup_property(). > > > > For example, for X86_64: > > > > int arch_setup_property(void *ehdr, void *phdr, struct file *f, bool inter) > > { > > int r; > > uint32_t property; > > > > r = get_gnu_property(ehdr, phdr, f, GNU_PROPERTY_X86_FEATURE_1_AND, > > &property); > > ... > > } > > > > Signed-off-by: H.J. Lu > > Signed-off-by: Yu-cheng Yu > > Did HJ write this patch as suggested by that SoB chain? If so, you lost > a From: line on top, if not, the SoB thing is invalid. I will fix that. Yu-cheng