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=-5.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 C2CA8C433E0 for ; Thu, 4 Feb 2021 23:42:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5639F64F3D for ; Thu, 4 Feb 2021 23:42:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5639F64F3D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C2D196B0006; Thu, 4 Feb 2021 18:42:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB63E6B006C; Thu, 4 Feb 2021 18:42:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7E296B006E; Thu, 4 Feb 2021 18:42:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 8F9C06B0006 for ; Thu, 4 Feb 2021 18:42:06 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5C4E81EF1 for ; Thu, 4 Feb 2021 23:42:06 +0000 (UTC) X-FDA: 77782211052.24.bun19_170f707275e0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 3D10B1A4A0 for ; Thu, 4 Feb 2021 23:42:06 +0000 (UTC) X-HE-Tag: bun19_170f707275e0 X-Filterd-Recvd-Size: 3596 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Feb 2021 23:42:04 +0000 (UTC) IronPort-SDR: HhN43sTcCPGNh5lEfB8nYTrSCfmdRyMg72KnqVQwLHjR8lCmZwosepIhyaxW4MHVM9WUl3wamI qg+5WLYGYuUA== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="177841892" X-IronPort-AV: E=Sophos;i="5.81,153,1610438400"; d="scan'208";a="177841892" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 15:42:03 -0800 IronPort-SDR: 6wbv918hvG4kwN5PthBfgEyPKVZYOVgV2Zh9AsIF6FZ0wwxkwPSieawgpnXjfujFsc4GNhN/d5 xzDq58RPrx2A== X-IronPort-AV: E=Sophos;i="5.81,153,1610438400"; d="scan'208";a="483749298" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.209.100.6]) ([10.209.100.6]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 15:42:00 -0800 Subject: Re: [PATCH v19 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: Kees Cook 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 References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-25-yu-cheng.yu@intel.com> <202102041235.BA6C4982F@keescook> From: "Yu, Yu-cheng" Message-ID: <6d7dd90f-dc03-06ce-57a2-57e4c2f803f3@intel.com> Date: Thu, 4 Feb 2021 15:41:59 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <202102041235.BA6C4982F@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2/4/2021 12:35 PM, Kees Cook wrote: > On Wed, Feb 03, 2021 at 02:55:46PM -0800, Yu-cheng Yu wrote: >> arch_prctl(ARCH_X86_CET_STATUS, u64 *args) >> Get CET feature status. >> >> The parameter 'args' is a pointer to a user buffer. The kernel returns >> the following information: >> >> *args = shadow stack/IBT status >> *(args + 1) = shadow stack base address >> *(args + 2) = shadow stack size > > What happens if this needs to grow in the future? Should the first u64 > contain the array size? > > Otherwise, looks sensible. > > -Kees > The first item is a bitmap, and there are two possible bits. Should there be a need, we can then do things about it. My thought at the moment is, we may not meet the situation. Can we keep this for now? -- Yu-cheng