Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4072741pxu; Mon, 12 Oct 2020 08:48:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJmnSzBc+Z+NXhqNWciEcKxcwasnzAE/X9aoPosu96effdsrQ5fFQNWOnQ6IfPkAUMcG+R X-Received: by 2002:aa7:d143:: with SMTP id r3mr13295084edo.103.1602517702401; Mon, 12 Oct 2020 08:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602517702; cv=none; d=google.com; s=arc-20160816; b=JXiJQoaZtvdmQ711jAM2MfVxaFcRk48fOnykH/P0gb6uRjjHTz8rKRgt3UkuVsmQIn ubosBTrK5vSQOngL+QrT+bInYfWwzkHxivyoxtku1umRAsPWoz4rda6VaM84MyWfO4xQ O4g+1o+X49Kx7HNbaiuNBcgIQwAvZXq7GffEVT+MTSPWHyTDnai3fx4MoVl/rIjhPyUN B3qaqykXdEZD3TqjhZsCsE7otWc+DXooLNLMuRb5cuPrbMux1U3duVylBkW/ps0LJD4M Aak+rqH0aFZOZLYlFz3F/JPXA3jGv67DGixsHiK7dauPa83uKjpdN5rKaJjFQETDlIKn CflA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=kUby+HNkYeZ58PefenQa8pZXIkYEdGrUW9sJNcRZuqQ=; b=y4Mh7EI3fzCdJ2NVHOV8Ix5LHjiN43VnNxCaN7zsBaIEeHELJrd/MMwkW0zjapSDt8 2U6H7mZBHu1gNII7AwHDbI5llHi8BNKTxAOwesIPFD9lAcfS7SQfUI8p6m83NGGvn+nw eq8bDSKR06950iZ0+sjk10lqTpUgJbAuGV77Y+hUePaNSbg6MZzGN98tNMitrwnL1s6S jK4KWp41X5zifVLOOfKefM8df9to+DJ021h8f79OSKZ8NQGUMpazlp4zGmcYoYBSx/+Z o91TDigE1UyEjDoG0Svrf4WAveJBTfKQZj6STwb0kubUddg7bM0O3ctXYj40SNu3H+LP 5X7w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si12102176ejg.134.2020.10.12.08.47.59; Mon, 12 Oct 2020 08:48:22 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390017AbgJLPpx (ORCPT + 99 others); Mon, 12 Oct 2020 11:45:53 -0400 Received: from mga07.intel.com ([134.134.136.100]:28363 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389679AbgJLPpv (ORCPT ); Mon, 12 Oct 2020 11:45:51 -0400 IronPort-SDR: Xmub+Y5kvXGsrjTyjWsoyN9zHpDc1wAoJECUFmd4A6CJn8Kf2u9i354qBES4Sa9gTtJuJKK2W5 2jgUZU7rxauw== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="229939272" X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="229939272" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 08:45:50 -0700 IronPort-SDR: yS/7RiddGAclWwbaoIWSfXQ7X453w41ye5ZUMBbKZ7HAblE59SP21/Y4DZ/WElwvxGnOSijulU rprbjoIuvbHg== X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="530012625" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 08:45:49 -0700 From: Yu-cheng Yu To: 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 , Borislav Petkov , 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 Cc: Yu-cheng Yu Subject: [PATCH v14 1/7] x86/cet/ibt: Add Kconfig option for user-mode Indirect Branch Tracking Date: Mon, 12 Oct 2020 08:45:24 -0700 Message-Id: <20201012154530.28382-2-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20201012154530.28382-1-yu-cheng.yu@intel.com> References: <20201012154530.28382-1-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce Kconfig option X86_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 --- arch/x86/Kconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4b28a0ce4594..15c7f2606c9d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1966,6 +1966,25 @@ config X86_SHADOW_STACK_USER If unsure, say N. +config X86_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_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. + Support for this feature is only known to be present on + processors released in 2020 or later. CET features are also + known to increase kernel text size by 3.7 KB. + + If unsure, say N. + config EFI bool "EFI runtime service support" depends on ACPI -- 2.21.0