From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCBD1C433DB for ; Thu, 4 Feb 2021 20:33:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6054A64E4E for ; Thu, 4 Feb 2021 20:33:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6054A64E4E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB9526B0006; Thu, 4 Feb 2021 15:33:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E443C6B006E; Thu, 4 Feb 2021 15:33:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4B796B0070; Thu, 4 Feb 2021 15:33:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id B0DC46B0006 for ; Thu, 4 Feb 2021 15:33:12 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7C843181AEF1A for ; Thu, 4 Feb 2021 20:33:12 +0000 (UTC) X-FDA: 77781735024.18.lip91_5d17664275df Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 4F79E100ED0F8 for ; Thu, 4 Feb 2021 20:33:12 +0000 (UTC) X-HE-Tag: lip91_5d17664275df X-Filterd-Recvd-Size: 4516 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Feb 2021 20:33:11 +0000 (UTC) Received: by mail-pf1-f177.google.com with SMTP id b145so2846494pfb.4 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=osbjQyAgLsLynGiznzffKOhJ6gJuCrBJYPw4/0nLHKtHpN2Wg7S/VmzLtS90NikseE 4NpP8kZJDjI5yeVSjBhZ1IpjVqDzwcxH5iVtyxVxcJ0Hpum2SqfNmi3fBvpgbD5KSZ1x qTF6LVR9SpyJg8SGuR+Wn8GRl1JIA78CqKulMkfjcT0Wp476UgwFzdYLKlTl2oyRFqcC ofOGv1oc8D1AfgBbRPpxVo5v6gdraQqjvnaQViHZwXMfQ144SCXN3k5fTAUrz8nMp4w3 YObxQsx79ypRQO+mVfAu9vvav3xVqfQIpqLTU/CzLyR1Fye90jt3KctEwwk6xlnBD30f HzOg== X-Gm-Message-State: AOAM533dRhWFN0MZWnEGPHtwG0qfNO1KMg2ZS0sg/cwdsVXIEpAaOCw0 EUQ3bY9dqbT5PzDdTDRYjzn6EQ== X-Google-Smtp-Source: ABdhPJwJ8tkFZ1GvM2rS6EIJq9lw8kHUx/wvUF88J40CKTwNhAGVZNsM8/4iFq1PZVwRDJJhoNR3nQ== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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