Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp196347lqg; Wed, 10 Apr 2024 22:43:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwN5pajOs8WnGuitYD80bTkZ02hAYgx+FaLLoOc1wyDRP7uUmfxEw0krCVG072H3Dw1bbJ+zk+cxDqVFZiPINnTZKX613z5QFrJvLTNQ== X-Google-Smtp-Source: AGHT+IHehJ9m7eTJdEGZS0UupEITsHrWgHw/k6YpBp5xPy7ZAH872+q94mbdNlnjQzBwZfLkqprb X-Received: by 2002:a05:6214:1bc8:b0:69b:2aa8:dc61 with SMTP id m8-20020a0562141bc800b0069b2aa8dc61mr5116302qvc.29.1712814205252; Wed, 10 Apr 2024 22:43:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712814205; cv=pass; d=google.com; s=arc-20160816; b=Jdllv8K1/RpbhfhDNXyWKD6fT2y1I8o6lDmp7iKFxl8JxKLW1zsep1CO4INLTyFdN6 aeVP0iJ/SvbpAH0cvxeppiYn/k88NNuDgU3s484Nz8NR0yxmASAxWMazUZxNcIfDwK4T SETEdDwbuNIQd8q72F7zlbEG/JFWiU5RXD9TrvgDGHLxihtVK0JkQKOCEeCkQmHxWsEE p750/ZN/Z0AvF9MtAUWM0abvVQySSiFcQ6W3Lq/eoOukpMjJ4GrGdLgIQwVm3A27ZSTl q1lrNiu7+Qk8VpL46s2XQPIbDUGfnytfjAQ9CV8d6aSC4PaPRG7F/3blbeqqkXIx4rDj UwFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=o5HxlzYhsE3onS5xkVy/F1UmvxJf5miEe+gP2dy0IPI=; fh=7OJFrLnOA6s1ycE/HULnfMliS+3S6sqMIgc3sc3R36M=; b=xbso8K1Q0Hj89/R4ih4kC3/JofGXZ+nIZCCZoqWelGUW8wbFbYUhGQBNwywtgCH5nz uFlPN555Ntv+435TJXgGaOYMEhX/OjYS0ZcFZm2Om5L7VndHqo2PPLsTd0W5JuV9/fUX EUi9OVMtf9kR9mefTaP8ieUs1qXd96wd33V4upXfZ7GOwz6da9AJgbWz7GBgJxYGB5QL JqfxCnfNVRpNRxKE/7DYesGhnqVhzl2DFlNulRFO2kaTcL1fAFjkG56qTe+3uLj4duu1 o+hhCga2kABD5JsBm0gO+aVQtRPj6Mbhwxr2i89Swa5Ge0dRAITiXcfvoNMZ/HtK0YUO Ng1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s1zJmu7o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id db4-20020a056214170400b0069b4856b1b0si821397qvb.186.2024.04.10.22.43.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 22:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s1zJmu7o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D83B1C24092 for ; Thu, 11 Apr 2024 05:42:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE01713CFA3; Thu, 11 Apr 2024 05:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s1zJmu7o" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0AB113CABE for ; Thu, 11 Apr 2024 05:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712814120; cv=none; b=e/E3o6+nA55WoeSD0qT+11Dy/13WJJqcb4QiSBkbwEMXOGCvYD7LDLuByAgrJQoCdvs+jHkGVRUb8FpDvj7kwCaKftO6mjLVNkeJ+mN+VsacoXIaM+Cm6scWOJr4f4c0OiG53urJQrjutX4SHe2JAadOiCTj6FuVQ7bqWC0X8RA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712814120; c=relaxed/simple; bh=8AiXA+DvMaBCd3KyxnxGbBJo7F2pcvHfeTZpRIhDzak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XfsdG4jZ1UZTbc1lJ/zi/VLE34GyEMG4Eh8e/dBG98D0/v0eISEPkBRzmLrXGIrM5NtZ7YXYK7PG6cj/F5aTK4YA4Q32fyrri7lxKTUUastmL8JEX8wGyP7/qpgIv3ZmCKvJ+10stBldHmvCsmYeHhfhzHUhATVLitGzH6Mg4Dw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s1zJmu7o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABF4FC433F1; Thu, 11 Apr 2024 05:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712814120; bh=8AiXA+DvMaBCd3KyxnxGbBJo7F2pcvHfeTZpRIhDzak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s1zJmu7ozTzEs2sAGaOOK6yn/GO+QTVvd8eqICkfzqNyiLmK2Guly7awsSRzLnOqw yWnUjJYFk6By95gcAjGLXm1xJ2zNrTAZQIPcpos0broCHhXOSNPaMcTS7izfSdDzAK hnnYI+fEI1kFUXCJlMxovvG9DGwUQyfSxjcV0+1RSIrGo5jLu1vRTfulOEJUDWD/Um psdpRiGgy79JWZcHIBpdu8g1RpihW9es6oLHJvuDi6hfSs3gBV9nz4+LOiqesxsGVd VysGmfv5dJ6siM0D3qyGKYmXB9shwhjcwD9Exfh2MYwI5As/7zOhtTRd4sk0XfW/hq 1I8PZyjvnHWVw== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov Subject: [PATCH 4/7] x86/bugs: Clarify that syscall hardening isn't a BHI mitigation Date: Wed, 10 Apr 2024 22:40:48 -0700 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit While syscall hardening helps prevent some BHI attacks, there's still other low-hanging fruit remaining. Don't classify it as a mitigation and make it clear that the system may still be vulnerable if it doesn't have a HW or SW mitigation enabled. Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob") Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/hw-vuln/spectre.rst | 11 +++++------ Documentation/admin-guide/kernel-parameters.txt | 3 +-- arch/x86/kernel/cpu/bugs.c | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/admin-guide/hw-vuln/spectre.rst index 3cf18e4a1d9a..5a39acf82483 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -441,10 +441,10 @@ The possible values in this file are: - System is protected by BHI_DIS_S * - BHI: SW loop, KVM SW loop - System is protected by software clearing sequence - * - BHI: Syscall hardening - - Syscalls are hardened against BHI - * - BHI: Syscall hardening, KVM: SW loop - - System is protected from userspace attacks by syscall hardening; KVM is protected by software clearing sequence + * - BHI: Vulnerable + - System is vulnerable to BHI + * - BHI: Vulnerable, KVM: SW loop + - System is vulnerable; KVM is protected by software clearing sequence Full mitigation might require a microcode update from the CPU vendor. When the necessary microcode is not available, the kernel will @@ -661,8 +661,7 @@ kernel command line. spectre_bhi= [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. Syscalls are hardened against BHI - regardless of this setting. This setting affects the deployment + (BHI) vulnerability. This setting affects the deployment of the HW BHI control and the SW BHB clearing sequence. on diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a029ad6c4963..a3874cc97892 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6065,8 +6065,7 @@ See Documentation/admin-guide/laptops/sonypi.rst spectre_bhi= [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. Syscalls are hardened against BHI - reglardless of this setting. This setting affects the + (BHI) vulnerability. This setting affects the deployment of the HW BHI control and the SW BHB clearing sequence. diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 0755600d5d18..a65c70709bb5 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2818,10 +2818,10 @@ static const char * const spectre_bhi_state(void) return "; BHI: SW loop, KVM: SW loop"; else if (boot_cpu_has(X86_FEATURE_RETPOLINE) && rrsba_disabled) return "; BHI: Retpoline"; - else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT)) - return "; BHI: Syscall hardening, KVM: SW loop"; + else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT)) + return "; BHI: Vulnerable, KVM: SW loop"; - return "; BHI: Vulnerable (Syscall hardening enabled)"; + return "; BHI: Vulnerable"; } static ssize_t spectre_v2_show_state(char *buf) -- 2.44.0