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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 5BBC7C433DB for ; Tue, 23 Mar 2021 21:03:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0326460200 for ; Tue, 23 Mar 2021 21:03:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0326460200 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 88F7D8D0025; Tue, 23 Mar 2021 17:03:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 83E418D0022; Tue, 23 Mar 2021 17:03:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DEDB8D0025; Tue, 23 Mar 2021 17:03:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 5316A8D0022 for ; Tue, 23 Mar 2021 17:03:46 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F07825DFD for ; Tue, 23 Mar 2021 21:03:45 +0000 (UTC) X-FDA: 77952365610.12.2BBC031 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf14.hostedemail.com (Postfix) with ESMTP id 2B3C2C0007C9 for ; Tue, 23 Mar 2021 21:03:42 +0000 (UTC) IronPort-SDR: p1sf9NbXLALViAZFMzLJ8eSbJOIAE9Et1x6Ulf+2yewoDGC6lv6hR5ra8WXLgnONjk7IMyDkGR ICkiCeU4HyjQ== X-IronPort-AV: E=McAfee;i="6000,8403,9932"; a="190662968" X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="190662968" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 14:03:43 -0700 IronPort-SDR: MeVn035X0DnNhkg1ktcTUNDoBtJVhhAZ7Cud4eLJ8Ee/Ta0TQIKBo35AS40MPkUMefwCl6pYBB Wtim3d7C3Cag== X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="452304540" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.209.32.182]) ([10.209.32.182]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 14:03:41 -0700 Subject: Re: [PATCH v23 00/28] Control-flow Enforcement: Shadow Stack To: Peter Zijlstra Cc: Borislav Petkov , 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 , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang References: <20210316151054.5405-1-yu-cheng.yu@intel.com> <20210316211552.GU4746@worktop.programming.kicks-ass.net> <20210323204932.GC4746@worktop.programming.kicks-ass.net> From: "Yu, Yu-cheng" Message-ID: <80890046-f91f-f512-6c71-b6c963905636@intel.com> Date: Tue, 23 Mar 2021 14:03:41 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210323204932.GC4746@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: cbdweh6xryjhz59hsaprj199zrdhgttg X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2B3C2C0007C9 Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=mga09.intel.com; client-ip=134.134.136.24 X-HE-DKIM-Result: none/none X-HE-Tag: 1616533422-554965 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 3/23/2021 1:49 PM, Peter Zijlstra wrote: > On Fri, Mar 19, 2021 at 02:43:04PM -0700, Yu, Yu-cheng wrote: >> On 3/16/2021 2:15 PM, Peter Zijlstra wrote: >>> On Tue, Mar 16, 2021 at 08:10:26AM -0700, Yu-cheng Yu wrote: >>>> Control-flow Enforcement (CET) is a new Intel processor feature that blocks >>>> return/jump-oriented programming attacks. Details are in "Intel 64 and >>>> IA-32 Architectures Software Developer's Manual" [1]. >>>> >>>> CET can protect applications and the kernel. This series enables only >>>> application-level protection, and has three parts: >>>> >>>> - Shadow stack [2], >>>> - Indirect branch tracking [3], and >>>> - Selftests [4]. >>> >>> CET is marketing; afaict SS and IBT are 100% independent and there's no >>> reason what so ever to have them share any code, let alone a Kconfig >>> knob. >>>> In fact, I think all of this would improve is you remove the CET name >>> from all of this entirely. Put this series under CONFIG_X86_SHSTK (or >>> _SS) and use CONFIG_X86_IBT for the other one. >>> >>> Similarly with the .c file. >>> >>> All this CET business is just pure confusion. >>> >> >> What about this, we bring back CONFIG_X86_SHSTK and CONFIG_X86_IBT. >> For the CET name itself, can we change it to CFE (Control Flow Enforcement), >> or just CF? > > Carry Flag :-) > >> In signal handling, ELF header parsing and arch_prctl(), shadow stack and >> IBT pretty much share the same code. It is better not to split them into >> two sets of files. > > Aside from redoing the UAPI we're stuck with that I suppose :/ And since > I think the CET name is all over the UAPI, you might as well keep it for > the kernel part of it as well :-( > > But if there's sufficient !UAPI bits it might still make sense to also > have ibt.c and shstk.c > I will move code around and separate it into shadow stack and ibt. Hopefully in the next iteration, things will be more organized. Thanks, Yu-cheng