Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp872571rwi; Fri, 14 Oct 2022 09:36:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uyCNoIMeLSnE1lEktZBnH+PgWK1sQoSeUeGhslSrs5Fw3sXtTR27RXVgXKcohbfSfTB05 X-Received: by 2002:a17:907:7287:b0:78d:8f26:5911 with SMTP id dt7-20020a170907728700b0078d8f265911mr3978137ejc.463.1665765394213; Fri, 14 Oct 2022 09:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665765394; cv=none; d=google.com; s=arc-20160816; b=g31KaR5mdsD9cd68X6vPwLwNvr0M0WXz6a8HzqMj8HzCcbS25S7KaDRee/iC+UiLSj rEYNnF46XXIUyhI6FdcVBv8hWz5uwcXpQdZPOlHPUSPsqaLBv2RSFIkkIBE90WBmGGbU ypMEWA7qv5QW1T0bWd+BuM4IU/PqzEM2jKZIhmi1pJuIn2WvCbkxdN82BSamPqjx6ktt FSDtMOYcUqaNp+WYfpnNksE0D0eA9Q9LrXrGFaJ0/hyWXnV1I9i8Hn4E5EKYlY3KPi0/ nN7QCAKW9E1INmPI36gwSGKL+4qu+IfqVm7NPL2vGHRHl4uNqR3kJN/BIXQ1XHy4OX4e 3atA== 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=/Wh0zbFGTIbft2gDvKR16DzRYnJEB/RKZdQTzdqS+mY=; b=IkOE2AHtZyxtDwhccnrGcyl343LibMmlwUpE8RcQFpKUv2jiuFsgjsbiJp6201AIdY q+0vR2JxW96q8lgCHYxiz7QNeRTVHtC74Nm9o63a9Biu6AzqObo5fFfkNyp+Wqc+TKNJ N4LXuZeNsTd8Ht7EaJ4IdkXsC0N1cJ13XoqUhoaS58OhOq3+QnMK8DC7ejROZSyIWV/K e/Mq2qnnnmbESl6mo0Dh6YVrHsL2aVqlZ4aCGoHo+J73m72jwKyUdLCpBVfgI1UKHcCV VMnMM8pJX7kbdsKyzBplvxByEfEP9yxovFeFevWgO3K/F538gL1YBK2ORad9YMIZXkPN pEww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ph9EsHV1; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gq2-20020a170906e24200b0078dc5b2b6c4si2297789ejb.666.2022.10.14.09.35.59; Fri, 14 Oct 2022 09:36:34 -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=@alien8.de header.s=dkim header.b=ph9EsHV1; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiJNQU6 (ORCPT + 99 others); Fri, 14 Oct 2022 12:20:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbiJNQUx (ORCPT ); Fri, 14 Oct 2022 12:20:53 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C3A7E4C21; Fri, 14 Oct 2022 09:20:49 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7ed329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7ed:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 309AA1EC064E; Fri, 14 Oct 2022 18:20:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1665764444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=/Wh0zbFGTIbft2gDvKR16DzRYnJEB/RKZdQTzdqS+mY=; b=ph9EsHV1y0KX4HYpc4X1/DaIFwwH07WDdjPORZ/cMJunsKSVMNLOUJerlurPUwYFdShdbq hM6gbuhSJQA9gypG8KSA/BUTXwUIMb9AeMGlJ0BFu7DaYO18AYtvcvlpG1NMdPTlaX7cwf wWdoa6T2PDBLrPzaaR1c8h+EZX7yIt0= Date: Fri, 14 Oct 2022 18:20:38 +0200 From: Borislav Petkov To: Rick Edgecombe 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 , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V . Shankar" , Weijiang Yang , "Kirill A . Shutemov" , joao.moreira@intel.com, John Allen , kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, Yu-cheng Yu Subject: Re: [PATCH v2 03/39] x86/cpufeatures: Add CPU feature flags for shadow stacks Message-ID: References: <20220929222936.14584-1-rick.p.edgecombe@intel.com> <20220929222936.14584-4-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220929222936.14584-4-rick.p.edgecombe@intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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, Sep 29, 2022 at 03:29:00PM -0700, Rick Edgecombe wrote: > From: Yu-cheng Yu > > The Control-Flow Enforcement Technology contains two related features, > one of which is Shadow Stacks. Future patches will utilize this feature > for shadow stack support in KVM, so add a CPU feature flags for Shadow > Stacks (CPUID.(EAX=7,ECX=0):ECX[bit 7]). > > To protect shadow stack state from malicious modification, the registers > are only accessible in supervisor mode. This implementation > context-switches the registers with XSAVES. Make X86_FEATURE_SHSTK depend > on XSAVES. > > Signed-off-by: Yu-cheng Yu > Co-developed-by: Rick Edgecombe > Signed-off-by: Rick Edgecombe > Cc: Kees Cook Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette