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=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 91770C433E6 for ; Wed, 10 Feb 2021 19:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 509DD64E32 for ; Wed, 10 Feb 2021 19:42:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232995AbhBJTmF (ORCPT ); Wed, 10 Feb 2021 14:42:05 -0500 Received: from mga11.intel.com ([192.55.52.93]:39635 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232932AbhBJTls (ORCPT ); Wed, 10 Feb 2021 14:41:48 -0500 IronPort-SDR: EbWiv2hgZEXet/YSwr4LUv3JI0lliryTiXd/falh8ELSvNQ7+itc5nIVzfGMHC5BuCDelG2rsM Z6A+z9leWQ/g== X-IronPort-AV: E=McAfee;i="6000,8403,9891"; a="178632073" X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208";a="178632073" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 11:41:04 -0800 IronPort-SDR: KGA2BB3jRS+CMMBEPJAqj9sVyfhxs6cTMlumHyeSJGpdLcay/qMDdk70do9WapdKIkrKdBcdUp tLcMgVMycIcw== X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208";a="396888205" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.188.167]) ([10.212.188.167]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 11:40:58 -0800 Subject: Re: [PATCH v20 02/25] x86/cet/shstk: Add Kconfig option for user-mode control-flow protection To: Kees Cook 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 , haitao.huang@intel.com References: <20210210175703.12492-1-yu-cheng.yu@intel.com> <20210210175703.12492-3-yu-cheng.yu@intel.com> <202102101133.3C94A64@keescook> From: "Yu, Yu-cheng" Message-ID: <29b4b8ad-3bcd-8bc7-d6a1-6cea483eb2f6@intel.com> Date: Wed, 10 Feb 2021 11:40:57 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <202102101133.3C94A64@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On 2/10/2021 11:33 AM, Kees Cook wrote: > On Wed, Feb 10, 2021 at 09:56:40AM -0800, Yu-cheng Yu wrote: >> Shadow Stack provides protection against function return address >> corruption. It is active when the processor supports it, the kernel has >> CONFIG_X86_CET enabled, and the application is built for the feature. >> This is only implemented for the 64-bit kernel. When it is enabled, legacy >> non-Shadow Stack applications continue to work, but without protection. >> >> Signed-off-by: Yu-cheng Yu >> --- >> arch/x86/Kconfig | 23 +++++++++++++++++++++++ >> arch/x86/Kconfig.assembler | 5 +++++ >> 2 files changed, 28 insertions(+) >> >> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >> index 21f851179ff0..1138b5fa9b4f 100644 >> --- a/arch/x86/Kconfig >> +++ b/arch/x86/Kconfig >> @@ -28,6 +28,7 @@ config X86_64 >> select ARCH_HAS_GIGANTIC_PAGE >> select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 >> select ARCH_USE_CMPXCHG_LOCKREF >> + select ARCH_HAS_SHADOW_STACK >> select HAVE_ARCH_SOFT_DIRTY >> select MODULES_USE_ELF_RELA >> select NEED_DMA_MAP_STATE >> @@ -1951,6 +1952,28 @@ config X86_SGX >> >> If unsure, say N. >> >> +config ARCH_HAS_SHADOW_STACK >> + def_bool n >> + >> +config X86_CET >> + prompt "Intel Control-flow protection for user-mode" >> + def_bool n >> + depends on X86_64 > > This depends isn't needed any more. With that fixed: Yes, that's right. I will remove it. > > Reviewed-by: Kees Cook > Thanks! -- Yu-cheng