Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3862475rwb; Sun, 20 Nov 2022 23:57:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6kxx1KpGuT3SdIVVH0sRgF84s5wZRDVYIvRI7aQsqXzXUREAp9ZEM+6CNacqYmJwID8+BD X-Received: by 2002:a17:906:2ac3:b0:7ad:f2f9:2b49 with SMTP id m3-20020a1709062ac300b007adf2f92b49mr3333693eje.94.1669017456759; Sun, 20 Nov 2022 23:57:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669017456; cv=none; d=google.com; s=arc-20160816; b=AZNtIq6O2GSsc1HFZAElxeMuRHZWDr6TXiYeJekldp+8axd+3v/irUrAWCEXbTzIu9 q51Zxss9a4rQyM5cVC5oKQiogptkHV7fgU/Uolzx3ygttdwkVJ3lOnVSS4P7YR/h/O82 ujYhFSa02aqbrP4TLUk7tgRnkGTlMYy4eOCkFJx6DUcB4xNaF1ejS2JYRCr/Kx4rFZ99 Gh+u9E/Es62o7dAsR6yMlYTi0KY6IHO0QV1FAdqs4049Wp02OvXrF2Rl97n59jaxB+5g l7HVq9LTJ5ZonWuT7anJ/hjK+RlCWw2xT2JtcidQVLc82a3lTG0biMPUTOA/vrgEdh/g c07A== 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=O8xmrnqF5qIg2EjMtkhQkCrTH01JuJT42L0abMZ8L08=; b=LbvGn5bn/rEdyFkjCs5hujC+p1qPfRlRiEgQsiwZI25PebDdbA6WvmWGdshiQSn5vM pIbFSBglZek3/60Z/qyiY/AoFVPHLiaAv2LRkPImj6KwYbhifsHgSnNEkk41GzN7znA6 +FZjodGjQH8nQL37sg22tmdHb899ZwgUD0VlVGBks0URSaJo2ALzrQH2XJEGVZwvogtn 5ogpISGiXZ8/hfqi1L8sF4djKsPNZWu5twCfxltmUJKSMpotqYZDUrpBFlNEEphmnoKM C31xIKg5KkQ4NwIdgKOB1jxCaaUzYx3jggWmVvBmPJgDyzbc44WctV31xv6kVkSwHxzr JsrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ON7jOHT5; 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 oz33-20020a1709077da100b0073dced7204bsi9017296ejc.767.2022.11.20.23.57.14; Sun, 20 Nov 2022 23:57:36 -0800 (PST) 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=ON7jOHT5; 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 S229985AbiKUHll (ORCPT + 91 others); Mon, 21 Nov 2022 02:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbiKUHlU (ORCPT ); Mon, 21 Nov 2022 02:41:20 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6491B303F1; Sun, 20 Nov 2022 23:40:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 99ABECE0F54; Mon, 21 Nov 2022 07:40:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF4E3C433C1; Mon, 21 Nov 2022 07:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669016426; bh=ghyXIiLZQR1VJJWRY9yXFbB0NXqU+1Bza1GDza4IlCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ON7jOHT51zmDztSDGialBKHHhuuS8etEB+bzLNnYkOPuzYN8CzSyJhiEze7ax2aBO ufY0+yMDRRomJ5SnzKhYhmsL6IFNJvTPXwuvGvC4nRehqiVkfBBVAZCHUpbyuGe7zw 8qyR42WL6O0WdCVMdC4iY4YR8BPp6OFE19ah0VVphN7mby7bqoomsRHFPmCmvPqu1I ZnoM9Oh03Xtb+zWDQzFh9M7r0kiExUA3Ljpm5yUnN42RVxbzJFiKEVzguQV+9ZzUqd kosXMOvDYZShEIMFzkfzNMn4c3HLbi7MzR91+xzo1GdrseepOOBii5ghopRFO9hEbc WaVzQsjgH6RiQ== Date: Mon, 21 Nov 2022 09:40:03 +0200 From: Mike Rapoport To: "Edgecombe, Rick P" Cc: "Schimpe, Christina" , "peterz@infradead.org" , "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Yu, Yu-cheng" , "Eranian, Stephane" , "kirill.shutemov@linux.intel.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "jamorris@linux.microsoft.com" , "arnd@arndb.de" , "tglx@linutronix.de" , "pavel@ucw.cz" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "linux-doc@vger.kernel.org" , "john.allen@amd.com" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" , "akpm@linux-foundation.org" Subject: Re: [PATCH v3 35/37] x86/cet: Add PTRACE interface for CET Message-ID: References: <20221104223604.29615-1-rick.p.edgecombe@intel.com> <20221104223604.29615-36-rick.p.edgecombe@intel.com> <223bf306716f5eb68e4f9fd660414c84cddd9886.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Thu, Nov 17, 2022 at 07:57:59PM +0000, Edgecombe, Rick P wrote: > On Thu, 2022-11-17 at 12:25 +0000, Schimpe, Christina wrote: > > > Hmm, we definitely need to be able to set the SSP. Christina, does > > > GDB need > > > anything else? I thought maybe toggling SHSTK_EN? > > > > In addition to the SSP, we want to write the CET state. For instance > > for inferior calls, > > we want to reset the IBT bits. > > However, we won't write states that are disallowed by HW. > > Sorry, I should have given more background. Peter is saying we should > split the ptrace interface so that shadow stack and IBT are separate. > They would also no longer necessarily mirror the CET_U MSR format. > Instead the kernel would expose a kernel specific format that has the > needed bits of shadow stack support. And a separate one later for IBT. > > So the question is what does shadow stack need to support for ptrace > besides SSP? Is it only SSP? The other features are SHSTK_EN and > WRSS_EN. It might actually be nice to keep how these bits get flipped > more controlled (remove them from ptrace). It looks like CRIU didn't > need them. CRIU reads CET_U with ptrace(PTRACE_GETREGSET, NT_X86_CET). It's done before the injection of the parasite. The value of SHSTK_EN is used then to detect if shadow stack is enabled and to setup victim's shadow stack for sigreturn. -- Sincerely yours, Mike.