From mboxrd@z Thu Jan 1 00:00:00 1970 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 B8D783C17; Fri, 31 Oct 2025 14:02:40 +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=1761919360; cv=none; b=hSpN+ICtGq0bbxHs72o0DaspZuRDHUdG7kbqB5e/ALuSRzsalDu1gNPB9R8cMBXgEkzTQELcmwbIHTE1zf/zz1y1u9E6IB3XuCKNd0nRgOTcOALrPNmJqOQ2nJWvg0t0nj/ynFcHyPhe0xONWeIBOZPVpPABiBivIBSBw9YQXPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761919360; c=relaxed/simple; bh=3x62oLXxN77cIZsFPRRMtDBrs4udYaOcTZFgbyO66q0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YErGp7GB0IqjnXaHspE4BAVuKBUP9wXRzy2LY64fxq1gpVsZvk19XTmAw/sNmf4VYdUyGvZEWLq74mye1hZuB8vP57YSqZFC+Yrxe24GSzT0WV9o31sT93S+6wS1WNItI4TDTUle1nHyJUWJHEptCfs/w2dyVFYx7LGwvAvQ5tI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ciVg5NXM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ciVg5NXM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B87C4CEE7; Fri, 31 Oct 2025 14:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761919360; bh=3x62oLXxN77cIZsFPRRMtDBrs4udYaOcTZFgbyO66q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciVg5NXMrtJWqS/YfdTaAbsTuq9vOsEs1pJEn0KK75cgA7t1O9XOoEHCWgp/z/lnK PghU+4b10qGZnKOszDaB3v43ozJoMuy5jo2RZk4qsL+fpCoDjBUQnwtRVyR40zBv/I 9225NkViSuKojDHoORtm1EAjT9f/fXpQ3tIWuzxU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Kaplan , "Borislav Petkov (AMD)" , Sasha Levin Subject: [PATCH 6.6 07/32] x86/bugs: Fix reporting of LFENCE retpoline Date: Fri, 31 Oct 2025 15:01:01 +0100 Message-ID: <20251031140042.586975686@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251031140042.387255981@linuxfoundation.org> References: <20251031140042.387255981@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Kaplan [ Upstream commit d1cc1baef67ac6c09b74629ca053bf3fb812f7dc ] The LFENCE retpoline mitigation is not secure but the kernel prints inconsistent messages about this fact. The dmesg log says 'Mitigation: LFENCE', implying the system is mitigated. But sysfs reports 'Vulnerable: LFENCE' implying the system (correctly) is not mitigated. Fix this by printing a consistent 'Vulnerable: LFENCE' string everywhere when this mitigation is selected. Signed-off-by: David Kaplan Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/20250915134706.3201818-1-david.kaplan@amd.com Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/bugs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index f66e0e5b49eb1..ef1d3a5024ed4 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1594,7 +1594,7 @@ spectre_v2_user_select_mitigation(void) static const char * const spectre_v2_strings[] = { [SPECTRE_V2_NONE] = "Vulnerable", [SPECTRE_V2_RETPOLINE] = "Mitigation: Retpolines", - [SPECTRE_V2_LFENCE] = "Mitigation: LFENCE", + [SPECTRE_V2_LFENCE] = "Vulnerable: LFENCE", [SPECTRE_V2_EIBRS] = "Mitigation: Enhanced / Automatic IBRS", [SPECTRE_V2_EIBRS_LFENCE] = "Mitigation: Enhanced / Automatic IBRS + LFENCE", [SPECTRE_V2_EIBRS_RETPOLINE] = "Mitigation: Enhanced / Automatic IBRS + Retpolines", @@ -3222,9 +3222,6 @@ static const char *spectre_bhi_state(void) static ssize_t spectre_v2_show_state(char *buf) { - if (spectre_v2_enabled == SPECTRE_V2_LFENCE) - return sysfs_emit(buf, "Vulnerable: LFENCE\n"); - if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) return sysfs_emit(buf, "Vulnerable: eIBRS with unprivileged eBPF\n"); -- 2.51.0