Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2519911imm; Thu, 7 Jun 2018 12:02:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvf9jzmsA4i0u6HkwMFXnNEc0PpY/Q/y1Q+x7lSovQwPR85N6wsmW0C4BTsjkt2VnksX7o X-Received: by 2002:a17:902:bc85:: with SMTP id bb5-v6mr3177317plb.84.1528398159504; Thu, 07 Jun 2018 12:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398159; cv=none; d=google.com; s=arc-20160816; b=fw/mkyGZNq27rHHoWr2KT7/wZ31N2vhb9T1EqaK/zdW1Mv/nmEuwPAkEbLgcocMGuz lkxEwWrBvj74qArSWIRynAMF2OO4IAM+ad07yLI5I8ZxaYS611q0M+eqlV1bcdGWMp6Z bDg1rYMZmE3JhIbTT1YEMQOa4TkMKSRQ9cm/nEWSEihY1rQTQ7YZ8+OEd2XT2YRUWbPK P1le969aGQDOE2MZg3T+LhfqFk2lyb6+n6AgAAb7C1B0lDgCIfOrgWiNCTh1SpLUOiWl 4GX5CmpByRSo163tGeE5R7KA1mJQDmetFH2PcHZxkQcw7+vM9LG4h0PyBOz+fpoGf6kB 8FqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=UpE63isvIVvmWid1vL4aSbQ78fHuGL21+RbhQV0oj3Y=; b=HnCyWtKdTnv20V0Xvq+/mzx6T9CE7RDuYOM7824z8MYEja4rHP7S2BLaIMly3mJaTu NZXCI9Mj3RcupKrE0lfS+4kk2Hhr6AJvO3YqwWlJskyDGa7cngB6ItWgQ9tkpyX/z0sw DdP9H2Maq/d5bIUkePajxYZydXCfbrF8WAogVWkrFlqYWgLxdHDVxWDWNQqvEXtzJCPZ TIG3OfYnCmw93WVnAT7TwjKTit+Uy49U9cccGn2jkNaM1GXYLlfTKS9vMPS/xQ+NCBO+ P2gC91V1daxTlzRxP5W86eRqJ/u1JC35oFai55lXGzvH0Q3dmMisvocksCOVmsLGfEv0 QlWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=shyfW/RB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25-v6si7679021pfh.101.2018.06.07.12.02.24; Thu, 07 Jun 2018 12:02:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=shyfW/RB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933509AbeFGQoW (ORCPT + 99 others); Thu, 7 Jun 2018 12:44:22 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56274 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932781AbeFGQoU (ORCPT ); Thu, 7 Jun 2018 12:44:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UpE63isvIVvmWid1vL4aSbQ78fHuGL21+RbhQV0oj3Y=; b=shyfW/RBQpyqsYJfZXJdaGTR2F HmvlDeIpEVe6APUTWWksfIFCmv5IrJGTkOIbe4M4G7O/xSww5AGcoOLaEWHsTe28VgGbiEaclxKtq ozrZldD7fyKneeOJkJpJj2Ag+ZvJSQCMl+ttcdzNDrgmHGOE7nmWikfnvuVycOOSW+3BF+YlpIkJj +NourjxcrndfBD22IVSFQMm2eggS3p6jRYW/oepJngRj/obZt3KQF3qf1XLFVdWgzuog47cOlP2Z4 QjmVGWQGot7joep4XIhFh+r2AU+gTl0C+Zuntm1g0AlRzVQys73UbZ18+ZkVHVHH/UEfeNYoeXZST F87JQiqw==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQy0u-0001hC-0a; Thu, 07 Jun 2018 16:43:52 +0000 Subject: Re: [PATCH 1/7] x86/cet: Add Kconfig option for user-mode Indirect Branch Tracking To: Yu-cheng Yu , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "H.J. Lu" , Vedvyas Shanbhogue , "Ravi V. Shankar" , Dave Hansen , Andy Lutomirski , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , Mike Kravetz References: <20180607143855.3681-1-yu-cheng.yu@intel.com> <20180607143855.3681-2-yu-cheng.yu@intel.com> From: Randy Dunlap Message-ID: <9c99f892-8965-8b08-4a80-506b48c2205d@infradead.org> Date: Thu, 7 Jun 2018 09:43:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180607143855.3681-2-yu-cheng.yu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/2018 07:38 AM, Yu-cheng Yu wrote: > The user-mode indirect branch tracking support is done mostly by > GCC to insert ENDBR64/ENDBR32 instructions at branch targets. > The kernel provides CPUID enumeration, feature MSR setup and > the allocation of legacy bitmap. > > Signed-off-by: Yu-cheng Yu > --- > arch/x86/Kconfig | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 24339a5299da..27bfbd137fbe 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1953,6 +1953,18 @@ 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 > + select X86_INTEL_CET > + select ARCH_HAS_PROGRAM_PROPERTIES > + ---help--- > + Indirect Branch Tracking provides hardware protection against > + oriented programing attacks. programming and please just move the return/jmp parts to the next line also: protection against return-/jmp-oriented programming attacks. > + > + If unsure, say y > + > config EFI > bool "EFI runtime service support" > depends on ACPI > -- ~Randy