Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2168532pxb; Fri, 5 Feb 2021 10:32:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxpTkdRlCDDg2Hu6yTJ9/4PaEgviP/OkelTXY2klRtPRgWDqHiHcefCSKcWy1gPJTuIZOa X-Received: by 2002:a05:6402:3487:: with SMTP id v7mr4986700edc.68.1612549933606; Fri, 05 Feb 2021 10:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612549933; cv=none; d=google.com; s=arc-20160816; b=XQr7E+Gn6SO1Tk9TUITTXlu8kzGm04iaqh1zOaxYj7tIJ8slzAcbDIuLKhZ8XFAVZk f93xAVypSI/ccZU6JNVaucci7NaRk4MDImQXLgR4qtzdTicSjMV0SXM2ApnymOF4q+YJ 48IoYNFxPQ7Y/wNaXKDD67y/Fh/1fO6H7OD8Ep7j/k3V/RF5GH2o0IOy63cnDFJbHmGi APvC4NAs9zVOgOLvbo59UT64SUOmiSL1S/pK/CGJt+Xk/nq/7c3iM7rOSpZvhpOVc1yA xDKflCE9BWYIBgpmludCNkgHfiFVjDIdHwZTAjAlMCUyS99y3tcNKaD44kHGncXT5kp1 UtuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9PTifcKN8spL3ClpqXcFGHeUFpoZ67atZiPMBU3wuDs=; b=KgaGOiABrvpNRvwOUJvrcbJ5aF8yCiGcmARAUBQYaIq/nYBlQFAVpkkEnUVe3SG+To ZOvaUD3xobWMOdkTKfC52licdJ/nFZlTrL8zGZC9Z/EN1JqVHQBbveXPDq+zmnQJ7tAI t6T0G6WzNzBLNJuzgAGTu0RJ4C9YNROp4IhT48lVJSESpbrHJMxCPZU3Qzw23mH2uCSv cZHSdx/QfshBOBZ0zLlQ9/VrFp0XXDPLmsEVKgDllHj0z0040pWMI2RAFT9JKxqpTjcn 5r/D1tJdnFD0Xx28shF0Y4BITFuyIREu623dbLFi3Gfhgpol34JiORRA5nGldIAkGdQn NVuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HS3+D2H5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp21si5228363ejc.108.2021.02.05.10.31.46; Fri, 05 Feb 2021 10:32:13 -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; dkim=pass header.i=@chromium.org header.s=google header.b=HS3+D2H5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233705AbhBEQrd (ORCPT + 99 others); Fri, 5 Feb 2021 11:47:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233433AbhBEQpN (ORCPT ); Fri, 5 Feb 2021 11:45:13 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34DEEC061786 for ; Fri, 5 Feb 2021 10:26:55 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id o16so5137477pgg.5 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=o19FsY+rzQI6EvQcEBBdmZfVxxw6E09oI+xhWAEGdr/hKgCgz1KwCAEBtdDYeZwAGG NgQajba8nMCEQuk4JXGCi/QS+nzJvKuUighpnvGHYIthl0Ainy34Rw/iY2sucH0MEV2U ZY5phpvVtw+z28rPaiJfn7U6MnEuxm60bEnln9h7pk01DjrLBIQCJoDAon/wL+v7tnvN ws5UqimDUrEGr0pFuHlZyL05JR0kP1Fc5eCFeogZUIakgJx+iKQNgaJ09PqAbrMc/OXJ skiBppc6JXmEOJ7aRTFl8MzIlfVTKKm16BiYXmiIw+Zy6T4gGbfNB2z6/tuJvJbYmeRc 4Y5Q== X-Gm-Message-State: AOAM530BrKHCG80yJRWcdn5X2RaMQJVxI1QqGHP+ZrLTtEllGgAuCThm gas4B94HVPr7eU2wFNEvkI8iAA== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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