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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 2639AC433C1 for ; Tue, 23 Mar 2021 20:49:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9AC09619CB for ; Tue, 23 Mar 2021 20:49:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AC09619CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BCD08D001D; Tue, 23 Mar 2021 16:49:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36DE38D0017; Tue, 23 Mar 2021 16:49:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 198738D001D; Tue, 23 Mar 2021 16:49:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id F22858D0017 for ; Tue, 23 Mar 2021 16:49:48 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AF97D8E5F for ; Tue, 23 Mar 2021 20:49:48 +0000 (UTC) X-FDA: 77952330456.19.3C6FCDB Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf02.hostedemail.com (Postfix) with ESMTP id D1926407F8DB for ; Tue, 23 Mar 2021 20:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n2keAYHmYw/YVTL7PvtDv0VPnQ+WyrD9i93/IeDB6CA=; b=L6fFr3JWTwXIPut2SRcVTu4FAx f3EA5NxGBDrrzXHWQc9lfvvoWVF7oob30Y7BKgoWWVUhu6PMYnOBTYrK0rT6rUdwsuxpOykK3t9Lm g5yioVj+5OsOZgj6mvNMy88muwwL9yku3YQnPyDLwSsyvd4ITbDsyvSPJnHUfABaa13sEgPZDKccL PrOl/sIMX6/UDFdP3sQhV9jJo3xy3fwPMGdoUYEcQ8d8EpJ4kkxT3dabmNMXKiHlhz9+DXFOdnp60 unf0lFBU3bnZUI9nT67zraE8+KWhJLkjZiFjFOWRn6+mL79EYClAFTqdHS+Y5Y72vKi4Blj/AUCkM vL0Ve5sw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lOny1-00FjQ9-6j; Tue, 23 Mar 2021 20:49:33 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 26CE79864DD; Tue, 23 Mar 2021 21:49:32 +0100 (CET) Date: Tue, 23 Mar 2021 21:49:32 +0100 From: Peter Zijlstra To: "Yu, Yu-cheng" 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 Subject: Re: [PATCH v23 00/28] Control-flow Enforcement: Shadow Stack Message-ID: <20210323204932.GC4746@worktop.programming.kicks-ass.net> References: <20210316151054.5405-1-yu-cheng.yu@intel.com> <20210316211552.GU4746@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D1926407F8DB X-Stat-Signature: unby7yuzbutzaw6btw7it197a1txffoj Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=desiato.infradead.org; client-ip=90.155.92.199 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616532586-757921 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 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