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 1A26EC433E0 for ; Fri, 5 Feb 2021 18:26:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5EBE764EE8 for ; Fri, 5 Feb 2021 18:26:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EBE764EE8 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 ADB146B0070; Fri, 5 Feb 2021 13:26:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8CFF6B0071; Fri, 5 Feb 2021 13:26:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97B396B0073; Fri, 5 Feb 2021 13:26:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 7EEEF6B0070 for ; Fri, 5 Feb 2021 13:26:56 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4D3FB8249980 for ; Fri, 5 Feb 2021 18:26:56 +0000 (UTC) X-FDA: 77785045632.13.birds26_111026e275e6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 2E8B918140B60 for ; Fri, 5 Feb 2021 18:26:56 +0000 (UTC) X-HE-Tag: birds26_111026e275e6 X-Filterd-Recvd-Size: 4990 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 18:26:55 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id 18so2737410pfz.3 for ; Fri, 05 Feb 2021 10:26:55 -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=9PTifcKN8spL3ClpqXcFGHeUFpoZ67atZiPMBU3wuDs=; b=HS3+D2H5qhhSXm5Mhv9pAeIQrIxIDrLLhrbubqDRQEHMzcshMMVXCtDGapcRO+w0Mh Ry8wZrTRSu5DzM6JkcjQdB4e+rwquqcyHdk4BllNxbt4vd8dhxxn1Gu3pKXPPcBOYGMW 19euoavfkMowdIXaQ6HyNSFWSTVzj4YuS1o84= 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=9PTifcKN8spL3ClpqXcFGHeUFpoZ67atZiPMBU3wuDs=; b=MbFnByXgBG1YgJAlhzJTssO/+ehUgsq7y85kbPHDzqQgXzADTRqDkMwgD62PmwcFEw 8242P65x+bPIQO8izIMXqGqYdf7sJQJk8rT55R+zQoPreewUO+6KQonCZLLsaCUBW00D eL6D4w1eDlU1owNAwtBxQZZEQt4rK83vS2Xb2GSWoHcOJYwxJfuPmLPpZFs3mFV6Bq+X fNaEgJl0/IjSwOoU6ZyIZ/KzuQi/sU+MhKPPD9Ns3p3FZSdUR28oSFc5Thq0OgQuGjVv +7bf8NbpLIntSnHmCAI2x/bsrrHaBDUCK24G8uq63Of2IPVSl4iC1YV133cB9yfTmQTk Lbsg== X-Gm-Message-State: AOAM530feHoyWXPqdkR3jHxtikrU6cECj3xUMclfs0MoFIY0etz3AaA5 Fgjv/xBNtYtXbn+gwUUx+JyTKQ== X-Google-Smtp-Source: ABdhPJyovoQ5m59St1KtJeobhPYp42OO5wY6rGeSKoIt1K/gK6R9dUzhVZK3/QwGz1Hw+E4zxyllEA== X-Received: by 2002:a63:1c08:: with SMTP id c8mr5528896pgc.228.1612549614604; Fri, 05 Feb 2021 10:26:54 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m4sm3441246pfd.130.2021.02.05.10.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 10:26:53 -0800 (PST) Date: Fri, 5 Feb 2021 10:26:52 -0800 From: Kees Cook To: "Yu, Yu-cheng" 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 Subject: Re: [PATCH v19 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack Message-ID: <202102051026.B250352D4@keescook> References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-25-yu-cheng.yu@intel.com> <202102041235.BA6C4982F@keescook> <6d7dd90f-dc03-06ce-57a2-57e4c2f803f3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d7dd90f-dc03-06ce-57a2-57e4c2f803f3@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 Thu, Feb 04, 2021 at 03:41:59PM -0800, Yu, Yu-cheng wrote: > 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? Ah, good point. Yes, since that's a bitmap it ends up describing what follows. This is fine as-is. Thanks! Reviewed-by: Kees Cook -- Kees Cook