Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1591503pxb; Thu, 4 Feb 2021 17:53:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAUhr1agxhqr3hDndvDF2CLTK6nB1pFisAARYi6LmTnrX3tSgZvlHHV5mz+QFQXrvOrNNd X-Received: by 2002:a17:906:f0c4:: with SMTP id dk4mr1816946ejb.6.1612490003099; Thu, 04 Feb 2021 17:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490003; cv=none; d=google.com; s=arc-20160816; b=y/33/Gdc9SapL0XlKa55GFDWsnSR46mf5ac3I1Lm+ZgZi6MKm6VpfvwaGXb5/dOMf7 Hh//xC4UnEAm6IquFl3830ORk9OSyDTAejr0DSWdFlHyquCQlhZ4LJ8BBaI5YvrbS5F3 xqaK7PrLuBpZ2aWzx011fgpfgOxp27ubPSULHTO34TE7cbiuViPtMmq6HorBBL/YOuIE D9af0cdMUycUHLUmvYsxDsZ2036911IVwhrwnd3zSZJLwuXHNzZJvjbPr7kht4uLeoLj 29cQx72VQO/jz8FQt0h/ePi8UzUvqPxeYIqW/b82gbdDR6IxOpeeeOWY3OJPxIC8gR1i s5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=4El2nv9WSvOEelDYSntOiDPC3neB3n1GOn0W2yAKIJI=; b=ourdxBIAT3CywBWwWREc/0+zEpOVxh2c8zp9F6o5LMay8le9Nw6vJrQZ5+2aVL2uhC RNH20QNPILz8I7E1qCrIAAegqWONcnll0P5XaPZbnabfTwvZlDY74Flr0bxxuBP0LRyB B09Q6BsIJMbi/mIP/rRVD+y5hfYtSeN6hjSv+OFbzsdn6q5ps595eofd6nNIHF7v+9Nx zAFY04mw1vq2YVz3qKOD8opMnk/RE8/H5+HdQlzJkDigaPHgm1+kx9t6wdTuxWRdxNHH GI5wpbccmQO8OxxGlgA07KMgLYf9FdG4adZT/8d/tCmajj6lyASc3sjo+Zt07iXqIdvI Vezw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si4037568edc.411.2021.02.04.17.52.58; Thu, 04 Feb 2021 17:53:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbhBDXoA (ORCPT + 99 others); Thu, 4 Feb 2021 18:44:00 -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-kernel@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