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 250F0C43381 for ; Thu, 4 Feb 2021 23:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7AAE64FB3 for ; Thu, 4 Feb 2021 23:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231208AbhBDXnz (ORCPT ); Thu, 4 Feb 2021 18:43:55 -0500 Received: from mga11.intel.com ([192.55.52.93]:19290 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbhBDXnu (ORCPT ); Thu, 4 Feb 2021 18:43:50 -0500 IronPort-SDR: paq73y+XUm9y5jV86oLfy3XQCor3hz9emY1clRXp4YE1QIUTnIPuLVOPe+lVU567RoH/pK/xE5 QkOPp/xRXpbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="177841889" X-IronPort-AV: E=Sophos;i="5.81,153,1610438400"; d="scan'208";a="177841889" 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 Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org 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