From patchwork Fri May 17 07:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuxuan Luo X-Patchwork-Id: 1936305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VgfTw3lXxz1ydW for ; Fri, 17 May 2024 17:58:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1s7sTv-0005xJ-KB; Fri, 17 May 2024 07:58:23 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1s7sTt-0005nE-GW for kernel-team@lists.ubuntu.com; Fri, 17 May 2024 07:58:21 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E108C3F363 for ; Fri, 17 May 2024 07:58:17 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a5a8f3bc8e0so221255766b.1 for ; Fri, 17 May 2024 00:58:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715932697; x=1716537497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3dnF30v5Vry52pL0cPHezEMIGNddrPwBUO91+XlmrvI=; b=WGNnLEUZD8zPX/ErgS3sVCjZPaZPjz/9bI/JmttIzqaJWXWERFKtoK3pYuN/eXHvP6 5+Z2UPIlGs6wbJaMslhi2aL99gOrae//UK3PVe+G3PPyCH8AgyjOkN78uwY5jz1YkekF vVNseqtP0XnKYC1EZ/MEsV4QgcS/UJ4zvnMqqj3dDru8fZwBiO5as55VFzxKzfwLpNxl EafOV5m6HNVdJ4j5yW3NSr/FjcenSCZVQ9Slc1f/g6JX8tFcwiEpXeqGKSg0C9mue8qR PyIezWTyLkzWG4a+ogCEFfny3D9S42EAgqBZUJnonYX9/z/f77ZXlzs+7HjMyNhuY7NX xcnw== X-Gm-Message-State: AOJu0YxNooXzX3soI75ZvT/SZ24Tkvlht+vnEIRsammogS1ZPq1DHwme I1xmvO3KhozBn6Dt2gnSN02cQNLQkAzSAjQ5mb1EI8W+aRqsfRZyWYzn7MhCguMf9pDimzXgyb5 8tz+3xNs3hH0Hxk/xth7dvBNTwDhAjFWjwx8jteKvWoh7BwxXq9SMXLcwOnR08x6GGWhMdAZ1kq Ahcg5dOEd8SOkq X-Received: by 2002:a17:906:289b:b0:a5a:8bc4:f503 with SMTP id a640c23a62f3a-a5a8bc4f988mr522804266b.25.1715932697234; Fri, 17 May 2024 00:58:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgX2fuOF2riaYKcPQUGm7R7meb5G5pUmh84wt5xWFBL/r4iUqdRat4njeaBHz0DWGEd934tQ== X-Received: by 2002:a17:906:289b:b0:a5a:8bc4:f503 with SMTP id a640c23a62f3a-a5a8bc4f988mr522803966b.25.1715932696963; Fri, 17 May 2024 00:58:16 -0700 (PDT) Received: from localhost.localdomain ([2001:67c:1562:8007::aac:4795]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b179f1sm1080016966b.212.2024.05.17.00.58.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 00:58:16 -0700 (PDT) From: Yuxuan Luo To: kernel-team@lists.ubuntu.com Subject: [PATCH 10/15] x86/bugs: Fix BHI documentation Date: Fri, 17 May 2024 03:57:23 -0400 Message-Id: <20240517075728.9722-11-yuxuan.luo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240517075728.9722-1-yuxuan.luo@canonical.com> References: <20240517075728.9722-1-yuxuan.luo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Josh Poimboeuf Fix up some inaccuracies in the BHI documentation. Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob") Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Reviewed-by: Nikolay Borisov Cc: Linus Torvalds Cc: Sean Christopherson Link: https://lore.kernel.org/r/8c84f7451bfe0dd08543c6082a383f390d4aa7e2.1712813475.git.jpoimboe@kernel.org (cherry picked from commit dfe648903f42296866d79f10d03f8c85c9dfba30) CVE-2024-2201 Signed-off-by: Yuxuan Luo --- Documentation/admin-guide/hw-vuln/spectre.rst | 15 ++++++++------- Documentation/admin-guide/kernel-parameters.txt | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/admin-guide/hw-vuln/spectre.rst index 8e003eb6ac0fd..fe50e9cb00282 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -439,11 +439,11 @@ The possible values in this file are: - System is protected by retpoline * - BHI: BHI_DIS_S - System is protected by BHI_DIS_S - * - BHI: SW loop; KVM SW loop + * - 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 + * - BHI: Syscall hardening, KVM: SW loop - System is protected from userspace attacks by syscall hardening; KVM is protected by software clearing sequence Full mitigation might require a microcode update from the CPU @@ -708,13 +708,14 @@ For user space mitigation: of the HW BHI control and the SW BHB clearing sequence. on - unconditionally enable. + (default) Enable the HW or SW mitigation as + needed. off - unconditionally disable. + Disable the mitigation. auto - enable if hardware mitigation - control(BHI_DIS_S) is available, otherwise - enable alternate mitigation in KVM. + Enable the HW mitigation if needed, but + *don't* enable the SW mitigation except for KVM. + The system may be vulnerable. For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9b38050fdf5f0..bccf22d167622 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2748,6 +2748,7 @@ nospectre_v2 [X86,PPC,S390,ARM64] retbleed=off [X86] spec_store_bypass_disable=off [X86,PPC] + spectre_bhi=off [X86] spectre_v2_user=off [X86] srbds=off [X86,INTEL] ssbd=force-off [ARM64] @@ -4611,11 +4612,12 @@ deployment of the HW BHI control and the SW BHB clearing sequence. - on - unconditionally enable. - off - unconditionally disable. - auto - (default) enable hardware mitigation - (BHI_DIS_S) if available, otherwise enable - alternate mitigation in KVM. + on - (default) Enable the HW or SW mitigation + as needed. + off - Disable the mitigation. + auto - Enable the HW mitigation if needed, but + *don't* enable the SW mitigation except + for KVM. The system may be vulnerable. spectre_v2= [X86] Control mitigation of Spectre variant 2 (indirect branch speculation) vulnerability.