Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1494693pxk; Fri, 18 Sep 2020 14:11:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAgr3B7283emjBqxAenx3zK5c0ztkUsVNdvLl/c0dzMGLbBXJ+JIY1sHp20L7kg7adQp7k X-Received: by 2002:a17:906:2b48:: with SMTP id b8mr39536469ejg.125.1600463518933; Fri, 18 Sep 2020 14:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600463518; cv=none; d=google.com; s=arc-20160816; b=NDisdivSZHEpA/ib7eG95ehm19vwKkZVa7qdlXzawa0spd0y9b6Z5iYDznUEsrBACj FEfBUeucf3L00TLuZ/Yew0yj+G21k+O9vngu7+bK7nWWuIg+9qLTeXOm+PJsd9V2FsZs 0OljITEXjVSs8hDAmXJ2Si9pVHC/rMi7LNVMEKzf4i3nEy0X2Qo/Pkq2fz3sbRSfmdwN Vv08cbquZiZmOVQAEepmhHj83rKaInRWfcoZGbuz7l7C+aQ4qBbyDgLCE1qm4K/6fSMt 9hSoegVBRij382JQzvG7AgPOryv72qrT3llGHKW/1dPnKhJATOGyvd5TxkgiPEOXev9p BdyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=w+JRBudUXUwvhqWVD0MYK11LyJ0UI5c0AJ1zYb0I180=; b=efZ8jyQB6ogsCeWsngvcliH2++daznx4j+pLHYt/W77L0v17CS3TEap3k5WQabX2nh hUNr7Aszjs/iWta7zmh286H6zul/Li8vKcn7ru38UpOaau7kD+dPAVfecGf7jKDKCIO8 pxTsxunwY/bUgRYs18eqeX2maLofNjzxL38zlC2WnVi/ncuLxrY/QL/onQOANBmx+9V9 mwc8pz7duGW5bIYFAUp3nwcTieZGM3rL+SatIdnYA+6eqvrRwFrN9v1i5gbjvh1HSLM2 ThzfMrWyYy430tn95gG0240JAG2ctJb+rDf7P/7vZNJLxWaJZWMi8Whdrh6bbPpEAqfU /Y4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=COcuUjQK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si3095802ejj.296.2020.09.18.14.11.35; Fri, 18 Sep 2020 14:11:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=COcuUjQK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbgIRVIn (ORCPT + 99 others); Fri, 18 Sep 2020 17:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgIRVIm (ORCPT ); Fri, 18 Sep 2020 17:08:42 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90297C0613CE; Fri, 18 Sep 2020 14:08:42 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id x2so7722867ilm.0; Fri, 18 Sep 2020 14:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w+JRBudUXUwvhqWVD0MYK11LyJ0UI5c0AJ1zYb0I180=; b=COcuUjQKCDlxz7P+q4njzvsBKQTbn10AHmBYf8JO+acP1tpubCco3zjeXuqVPZwPJh HVv6c4k+SRu1ZGz5olK0H/NuLJoEmr8aupTuMU2dEgwGZkUzBg/PnM4dLRpyzLF3vOFw F/UXet7zP/niFPvLImNwwbYsTXI4Qt8tRV37wR5IFmq5bIjuW1po8xRNKoz2zLTLdTSw k2QGytd4NWpYwi9O/IGV3sU0LkYz/J6Oo1ZKJ8GGLQz7yQ4Tw2v/prTxK4ulQQL/RM+e Cg+zpkArA+WJ+1D2KOOb4f2XDlQK+ZZaOJmmgqY77d/utgEM9990u1DP3PIcX7wVT0Rc At2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w+JRBudUXUwvhqWVD0MYK11LyJ0UI5c0AJ1zYb0I180=; b=DrrRHFQrxMJaCFESPnusN8vDDHExzrtN4+GL4XYI7RNWntJPXqIN2mR4Arfq9NIHYw uzdp0j7l1EAcHOZsrxEdf/mKdYLgS0XR2f+3RXWTE7yjJYy0ogjLS64JBBMZ/QZdDQvL BjH29Ax7KKQq3CiANB9D7kblTo0B+c9i6Qoqz4IqMzHxxXZ8b6IO8wensa4DFnH/DjJ6 J9ZIX10XPhI3Xnpe51z2i5vKqtMXH545TobofOh+4XhV4Ra9EQiHT5pUx+L2GDd+jgj1 dBBuv7DL5IAyyXB4mqspWxjVQY7gmeYngb3rdlKDXbaAHv1FUyHvoCMl73kiyWC+JeVy nqlQ== X-Gm-Message-State: AOAM5319jFXtTgJlkAzz8hEWhaloCipXuX9tIVbm9HveDWc8FelF6iFE uzHP6pY7m2q6cd3nXeyLSFqZPsOo3qNAvb0Eulw= X-Received: by 2002:a92:6a09:: with SMTP id f9mr31765508ilc.273.1600463321963; Fri, 18 Sep 2020 14:08:41 -0700 (PDT) MIME-Version: 1.0 References: <20200918192312.25978-1-yu-cheng.yu@intel.com> <20200918192312.25978-2-yu-cheng.yu@intel.com> <20200918205933.GB4304@duo.ucw.cz> In-Reply-To: <20200918205933.GB4304@duo.ucw.cz> From: "H.J. Lu" Date: Fri, 18 Sep 2020 14:08:06 -0700 Message-ID: Subject: Re: [PATCH v12 1/8] x86/cet/ibt: Add Kconfig option for user-mode Indirect Branch Tracking To: Pavel Machek Cc: Randy Dunlap , Yu-cheng Yu , "the arch/x86 maintainers" , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 1:59 PM Pavel Machek wrote: > > On Fri 2020-09-18 13:24:13, Randy Dunlap wrote: > > Hi, > > > > If you do another version of this: > > > > On 9/18/20 12:23 PM, Yu-cheng Yu wrote: > > > Introduce Kconfig option X86_INTEL_BRANCH_TRACKING_USER. > > > > > > Indirect Branch Tracking (IBT) provides protection against CALL-/JMP- > > > oriented programming attacks. It is active when the kernel has this > > > feature enabled, and the processor and the application support it. > > > When this feature is enabled, legacy non-IBT applications continue to > > > work, but without IBT protection. > > > > > > Signed-off-by: Yu-cheng Yu > > > --- > > > v10: > > > - Change build-time CET check to config depends on. > > > > > > arch/x86/Kconfig | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > > index 6b6dad011763..b047e0a8d1c2 100644 > > > --- a/arch/x86/Kconfig > > > +++ b/arch/x86/Kconfig > > > @@ -1963,6 +1963,22 @@ config X86_INTEL_SHADOW_STACK_USER > > > > > > If unsure, say y. > > > > > > +config X86_INTEL_BRANCH_TRACKING_USER > > > + prompt "Intel Indirect Branch Tracking for user-mode" > > > + def_bool n > > > + depends on CPU_SUP_INTEL && X86_64 > > > + depends on $(cc-option,-fcf-protection) > > > + select X86_INTEL_CET > > > + help > > > + Indirect Branch Tracking (IBT) provides protection against > > > + CALL-/JMP-oriented programming attacks. It is active when > > > + the kernel has this feature enabled, and the processor and > > > + the application support it. When this feature is enabled, > > > + legacy non-IBT applications continue to work, but without > > > + IBT protection. > > > + > > > + If unsure, say y > > > > If unsure, say y. > > Actually, it would be "If unsure, say Y.", to be consistent with the > rest of the Kconfig. > > But I wonder if Yes by default is good idea. Only very new CPUs will > support this, right? Are they even available at the market? Should the > help text say "if your CPU is Whatever Lake or newer, ...." :-) ? > CET enabled kernel runs on all x86-64 processors. All my machines are running the same CET enabled kernel binary. -- H.J.