Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1589495pxb; Thu, 4 Feb 2021 17:49:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3VXUtcze4VLIKtmQ8wzi2l/r2qNkWz7ZKrlzacwJY9lREAh7U1KcDXvnBYg4vm2M7demN X-Received: by 2002:a17:906:4cca:: with SMTP id q10mr1769548ejt.379.1612489757396; Thu, 04 Feb 2021 17:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612489757; cv=none; d=google.com; s=arc-20160816; b=Pu8ouzsC2NvIYL85MYh4htfCOELSNsyCqKAolsmzhh0YD9WveVo5Aoyb24sUmEztM9 /v5O6iVCGcJ8/EIYaPh3Ue3k0xhpxUtkI2Tf9jshP0+FRrRLj581IndIE0bO1yQKdo0h 1bzc3YeDE9pfR2RPPejEVcfeVBE2I8qNZqKATfzmtPuNSh4WtSYq5jsB0C/tDBu91hY1 Krax7QufRKuzOth27bTUMfOfkh621K7wMK19SaF0wcTikAZjIeGDjeEgWerrJ0X6Ixp2 Av4VQGfLkJkAqk7gQXcCBYEf/yGJ1PpF22NstP8a2rDWALSYr/PzhsyGkMgdkIp8q87A H1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NeprK6JinSqU49dQ1nFPWFvDyk0tPt3L+sHTBjkAdOQ=; b=g0ZrS12ii/TfT28UqSCs8MFY+7D03+UZ8tnAxsIh2Lw5ai2+/QV+xnGBZR8QPW4OLv BZtuI8o2sN4jGUSLEbCzt+y3oZGkW0Q0NRSKPTWdGnop/9lnmkk6kK9nXWkKGA7aDaJu nZaAMFKIJrLhAVQV1pXulHRXwpL1kqXjRFWXwWsbbSv9/fEshdkXJ6Lvys2T43bu8X16 Dg/odPAcbATDOwNY3YjwHxrqskBsKZD1gA9hdoJEFmgqn0qof+9Rc2xVI4Wm9YlvW5WH GX6DhroSj3xRWiEHLfTirlbo5OKaMVLJM/gNe9/iLuMOawczaLGkzVjOophRmktE6C60 D4nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="D8TSY/I5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si4324688edl.91.2021.02.04.17.48.53; Thu, 04 Feb 2021 17:49:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="D8TSY/I5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239791AbhBDUeQ (ORCPT + 99 others); Thu, 4 Feb 2021 15:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240236AbhBDUdv (ORCPT ); Thu, 4 Feb 2021 15:33:51 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7678FC06178A for ; Thu, 4 Feb 2021 12:33:11 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id t25so2952236pga.2 for ; Thu, 04 Feb 2021 12:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NeprK6JinSqU49dQ1nFPWFvDyk0tPt3L+sHTBjkAdOQ=; b=D8TSY/I574CxB1blhR9D6u6bOcOmqMCyck3xJ5THhC5s9Yd8CgpIT8NoEAaCVNnzIF hqt9PagwwXSj48djg6joitbyoM/L0tatsbpJDqfEOWr6yEJgz3sBN1eQVR4sg21XZUPY mkH0vkZw4SIIvp4oxgImT0qojz0l3OFPib5Uw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NeprK6JinSqU49dQ1nFPWFvDyk0tPt3L+sHTBjkAdOQ=; b=EuRmSUp2k1UGta2tbK21ug7m+96RtQUo7WE+1eUVTnnn2vlQQqksPCzJNnf/+jJd/g m57zVEaU08Y8kgOHVhzICmpfYo2VVyVPWhmnT5xmC51N2z7HLjT2P7N32e/Mj9rDQ2FZ VjJR1fysPP2MHGOEp5vqt5HVyGHoyOUdl4erU2M8XN+r7ptkyMtfomDtTvUfq6cw3LlX hXiw3sFk8dQ+oXgsRjcJrPYZt5i5Ari2PKpszz+AMGEyZ+koxDJRV/rcrc2mbshmDxtU u9w6HOES7gBRTW30MQtGDHCgo8XKQtaUXZZ/dbyQSGg8kWztKrDlUP3ctnKAs0/QcEHK qU9Q== X-Gm-Message-State: AOAM532KyTGgeTACaiIoD2gePj0vC28AixxIMl87agaD5+Zodh/B3x+v bxPNzaOop7wKk8lzUKypa0zCjQ== X-Received: by 2002:a65:6246:: with SMTP id q6mr807193pgv.6.1612470791075; Thu, 04 Feb 2021 12:33:11 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id r14sm7806546pgi.27.2021.02.04.12.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 12:33:10 -0800 (PST) Date: Thu, 4 Feb 2021 12:33:09 -0800 From: Kees Cook To: Yu-cheng Yu 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 , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Mark Brown , Catalin Marinas Subject: Re: [PATCH v19 22/25] ELF: Introduce arch_setup_elf_property() Message-ID: <202102041233.2FCCEABF1C@keescook> References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-23-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203225547.32221-23-yu-cheng.yu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 02:55:44PM -0800, Yu-cheng Yu wrote: > An ELF file's .note.gnu.property indicates arch features supported by the > file. These features are extracted by arch_parse_elf_property() and stored > in 'arch_elf_state'. > > Introduce x86 feature definitions and arch_setup_elf_property(), which > enables such features. The first use-case of this function is Shadow > Stack. > > ARM64 is the other arch that has ARCH_USE_GNU_PROPERTY and arch_parse_elf_ > property(). Add arch_setup_elf_property() for it. > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook