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.3 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,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 78273C433E0 for ; Tue, 19 Jan 2021 18:37:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03EA322E00 for ; Tue, 19 Jan 2021 18:37:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03EA322E00 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F394F6B002C; Tue, 19 Jan 2021 13:10:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE8006B002D; Tue, 19 Jan 2021 13:10:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB0BA6B002E; Tue, 19 Jan 2021 13:10:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id C3F196B002C for ; Tue, 19 Jan 2021 13:10:37 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 89F1A8249980 for ; Tue, 19 Jan 2021 18:10:37 +0000 (UTC) X-FDA: 77723314914.04.value92_2f16d5c27553 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 4EB86800DDEF for ; Tue, 19 Jan 2021 18:10:31 +0000 (UTC) X-HE-Tag: value92_2f16d5c27553 X-Filterd-Recvd-Size: 4145 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Jan 2021 18:10:29 +0000 (UTC) IronPort-SDR: 0/hn+iUrhQeeiedZYqxkbxTN/1MeVPfWbVlX1tzmNtxHiRE2aBDCtVrJezd4B37r2qfOsXmho8 kO5F10LyZRZQ== X-IronPort-AV: E=McAfee;i="6000,8403,9869"; a="158152392" X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="158152392" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 10:10:28 -0800 IronPort-SDR: MW+Y7Gj0C/LBuROhQHYbzeTL9GqKCSiDMootWJB1BDgmJJ+fW+k+A/nIJvJFMnk3f3BkFyB4T4 CBQDqs25p7+g== X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="571089734" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.209.139.183]) ([10.209.139.183]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 10:10:25 -0800 Subject: Re: [PATCH v17 02/26] x86/cet/shstk: Add Kconfig option for user-mode control-flow protection To: Borislav Petkov 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" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu References: <20201229213053.16395-1-yu-cheng.yu@intel.com> <20201229213053.16395-3-yu-cheng.yu@intel.com> <20210119110659.GG27433@zn.tnic> From: "Yu, Yu-cheng" Message-ID: Date: Tue, 19 Jan 2021 10:10:24 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210119110659.GG27433@zn.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/19/2021 3:06 AM, Borislav Petkov wrote: > On Tue, Dec 29, 2020 at 01:30:29PM -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_USER 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 | 22 ++++++++++++++++++++++ >> arch/x86/Kconfig.assembler | 5 +++++ >> 2 files changed, 27 insertions(+) >> >> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >> index 7b6dd10b162a..72cff400b9ae 100644 >> --- a/arch/x86/Kconfig >> +++ b/arch/x86/Kconfig >> @@ -1950,6 +1950,28 @@ config X86_SGX >> >> If unsure, say N. >> >> +config ARCH_HAS_SHADOW_STACK >> + def_bool n >> + >> +config X86_CET_USER > > That thing needs to be X86_CET. How many times do I need to type this > before you do it? > Yes, I totally understand that now. I was still thinking about separately enabling user/kernel mode. Perhaps I should have communicated that thought before the change. Sorry about that. I will update it. -- Yu-cheng