Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29498001rwd; Wed, 5 Jul 2023 12:46:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBkBDtzxOOWw16johvuFimUmjZLuO1qb7dsy7jBC1AQ4ERHgbYAeiAO8foCQcSpPqKlrNP X-Received: by 2002:a05:6a20:1611:b0:12e:65f8:10dd with SMTP id l17-20020a056a20161100b0012e65f810ddmr10226231pzj.53.1688586386870; Wed, 05 Jul 2023 12:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586386; cv=none; d=google.com; s=arc-20160816; b=S4le3l8sY8E++cWslYAq2TtsujFQU+6hdcxUBUkuH9BeNwAlGqTDgcXeX5dGxTOZ8i C6MULfEZ6KW2Uk/nVWIoBl5SDe+cUv9pt/Ld64LMVmQxO29el0c4v2PCgTXs8bruP7zD 1wx7Y7O778yUb/vDsr+iZdnvtbZCi+zUPuzZj3txfk7vMUzJ+BDGo8Ciya9W8mbUAJjp p+IxB3wwNtLv6ouXXAGKAx1Y5g/AmBMiuyTGUzTX7vt9pNep/ZzQT6ZcTfFFR2Fq87Dn 7wFoAszQSSWLdMrhxmo6zDvklec7pI74wpNrKd6FR9R37RQIizNAMQ7YJBhfWAgcjgNH tCiw== 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=imX+GMPQBkVIbLQsiTplKOnd6h6BQ1O2Gck/GOdLjAk=; fh=AQtSEfej0daodnfLzQidXiFX4uoPyPy//eUQgeB1DhI=; b=EzRSFn2B5fQ43XaA63SXBV1IsSt+rhNT6kLQiDRQEEJXot+EIMxXYa1MpRsGulEn+P 93EJq2Dpxb1fDvxp9SWhlcQuOLY0MZBnsSfjBUvYzjC4rmh0Tc6VoQnmLup5UBrZz/hz vcQyOIX1gXaflj67O8ColmM48Ttp27NvnJQXNnVKTXQxiNKR1fr9r21XgJ5y9ESe+WEX VuIIQZihXAnfT+c83o2sTJ8SvYZlNDqpDDMdbS3UnRJJA63MohpsTWl5XPw4dVC1+NxE X5W00ISXUrHyDCKNo8qDbuEGpsgc51TLpg9Y2jJB6ACaYAAPzMzzbJRaHz8YHJyIR+Nr MBBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rArXyDhG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1-20020a170902db0100b001b88e609e56si9562782plx.488.2023.07.05.12.46.12; Wed, 05 Jul 2023 12:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rArXyDhG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234061AbjGETRc (ORCPT + 99 others); Wed, 5 Jul 2023 15:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234039AbjGETRS (ORCPT ); Wed, 5 Jul 2023 15:17:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C57A7EFA; Wed, 5 Jul 2023 12:12:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D0AC616EE; Wed, 5 Jul 2023 19:10:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CF8FC433C7; Wed, 5 Jul 2023 19:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688584249; bh=fa13Rrp/ewRaXb15ROYQwSY3HRGY9tgXoBGOXCxz7qQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rArXyDhGF1qeLuF+8vWJDIK/3L3LjaPvhWozvBC873N6pi4MbeTwNwAiwB2VIO8h6 H1wZgqBv55CuKdgGKzBaOx1+aTzXj97ktJjjoYNYrnHUNlWeipg0mYZlwowYai1JCY pHd1zhhWKMbNZpkU1QRyUO0UFs24TGHkrcWXFOQO/3qDPNx1lcaErhu3E7ZSaV6zWQ fl80eJEGPWLHhYv4neHzkW7KlYXcejS+pjyFpgeI1wlvZED9d8Zoz1SrIqGuPbWjuF sCKJQYBvh+dsTB8CcTxnWyMgQobRcdSdt6ZzTMoOqxT247MLe8MwfcFtQzucR/H749 HI7K1Xf1aqnBA== Date: Wed, 5 Jul 2023 20:10:38 +0100 From: Mark Brown To: "Edgecombe, Rick P" Cc: "szabolcs.nagy@arm.com" , "Lutomirski, Andy" , "Xu, Pengfei" , "tglx@linutronix.de" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "nadav.amit@gmail.com" , "kirill.shutemov@linux.intel.com" , "david@redhat.com" , "Schimpe, Christina" , "Torvalds, Linus" , "peterz@infradead.org" , "corbet@lwn.net" , "nd@arm.com" , "jannh@google.com" , "linux-kernel@vger.kernel.org" , "debug@rivosinc.com" , "pavel@ucw.cz" , "bp@alien8.de" , "rdunlap@infradead.org" , "linux-api@vger.kernel.org" , "rppt@kernel.org" , "jamorris@linux.microsoft.com" , "arnd@arndb.de" , "john.allen@amd.com" , "bsingharora@gmail.com" , "mike.kravetz@oracle.com" , "dethoma@microsoft.com" , "oleg@redhat.com" , "andrew.cooper3@citrix.com" , "keescook@chromium.org" , "gorcunov@gmail.com" , "fweimer@redhat.com" , "Yu, Yu-cheng" , "hpa@zytor.com" , "x86@kernel.org" , "mingo@redhat.com" , "hjl.tools@gmail.com" , "linux-mm@kvack.org" , "Syromiatnikov, Eugene" , "akpm@linux-foundation.org" , "Yang, Weijiang" , "dave.hansen@linux.intel.com" , "linux-doc@vger.kernel.org" , "Eranian, Stephane" Subject: Re: [PATCH v9 23/42] Documentation/x86: Add CET shadow stack description Message-ID: <2a30ac58-d970-45c3-87d2-55396c0a83f9@sirena.org.uk> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Dmr76OeBT4pTBUQM" Content-Disposition: inline In-Reply-To: X-Cookie: Don't feed the bats tonight. X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Dmr76OeBT4pTBUQM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 05, 2023 at 06:45:38PM +0000, Edgecombe, Rick P wrote: > Looking at the docs Mark linked (thanks!), ARM has generic GCS PUSH and > POP shadow stack instructions? Can ARM just push a restore token at > setjmp time, like I was trying to figure out earlier with a push token > arch_prctl? It would be good to understand how ARM is going to > implement this with these differences in what is allowed by the HW. > If there are differences in how locked down/functional the hardware > implementations are, and if we want to have some unified set of rules > for apps, there will need to some give and take. The x86 approach was > mostly to not support all behaviors and ask apps to either change or > not enable shadow stacks. We don't want one architecture to have to do > a bunch of strange things, but we also don't want one to lose some key > end user value. GCS is all or nothing, either the hardware supports GCS or it doesn't. There are finer grained hypervisor traps (see HFGxTR_EL2 in the system registers) but they aren't intended to be used to disable partial functionality and there's a strong chance we'd just disable the feature in the face of such usage. The kernel does have the option to control which functionality is exposed to userspace, in particular we have separate controls for use of the GCS, the push/pop instructions and the store instructions (similarly to the control x86 has for WRSS). Similarly to the handling of WRSS in your series my patches allow userspace to choose which of these features are enabled. --Dmr76OeBT4pTBUQM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSlwC0ACgkQJNaLcl1U h9DuvAf+JgrHCBe/TIeWaTXbh1FnwnOIdz2doyUlgUqzu5K5fGjE+AF6nytAvxsw HIFAEaZItokV1L7RHKWjunwM1sjA7UmdGfhH1i5KYZF8XpmfgZTK3ZiaHJO8EKsL WAN1sgXlNOkCfoE0vggDqr9ksQ5WGjJS3TDgoXnTQna75/J3ggrKWQPdBRZ52/YK Swo9HHZ/aUSvO8Xo6iSEetZIyxUjcDvPVGBNrMauABpExP1ww/LA7NeJIUF8O32/ ZYRWOy09jbfMJA80DH+bfaHVJw/g9ZI65/tBFI364wcp4LXSiymoz6f3yQUyBJV4 97UBNALINVmtmDPEpmSVX6DM3PbVWA== =HVOg -----END PGP SIGNATURE----- --Dmr76OeBT4pTBUQM--