lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176755431116.510.16624657260337348261.tip-bot2@tip-bot2>
Date: Sun, 04 Jan 2026 19:18:30 -0000
From: "tip-bot2 for Rong Zhang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Rong Zhang <i@...g.moe>, "Borislav Petkov (AMD)" <bp@...en8.de>,
 x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/cleanups] x86/split_lock: Remove dead string when
 split_lock_detect=fatal

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     6823f10dcc84f35ca652eff0448f7da3d3b26548
Gitweb:        https://git.kernel.org/tip/6823f10dcc84f35ca652eff0448f7da3d3b26548
Author:        Rong Zhang <i@...g.moe>
AuthorDate:    Tue, 16 Dec 2025 02:11:51 +08:00
Committer:     Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Sun, 04 Jan 2026 14:26:02 +01:00

x86/split_lock: Remove dead string when split_lock_detect=fatal

sld_state_show() has a dead str1 below:

  if (A) {
  	...
  } else if (B) {
  	pr_info(... A ? str1 : str2 ...);
  }

where A is always false in the second block, implied by the "if (A) else"
pattern. Hence, str2 is always used.

This seems to be some mysterious legacy inherited from the earlier patch
revisions of

  ebb1064e7c2e ("x86/traps: Handle #DB for bus lock").

Earlier revisions¹ did enable both sld and bld at the same time to detect
non-WB bus_locks when split_lock_detect=fatal, but that's no longer true in
the merged revision.

Remove it and translate the pr_info() into its equivalent form.

¹ https://lore.kernel.org/r/20201121023624.3604415-3-fenghua.yu@intel.com

  [ bp: Massage commit message; simplify braces ]

Signed-off-by: Rong Zhang <i@...g.moe>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Link: https://patch.msgid.link/20251215182907.152881-1-i@rong.moe
---
 arch/x86/kernel/cpu/bus_lock.c |  9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/bus_lock.c b/arch/x86/kernel/cpu/bus_lock.c
index dbc99a4..fb16666 100644
--- a/arch/x86/kernel/cpu/bus_lock.c
+++ b/arch/x86/kernel/cpu/bus_lock.c
@@ -410,13 +410,10 @@ static void sld_state_show(void)
 		}
 		break;
 	case sld_fatal:
-		if (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT)) {
+		if (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT))
 			pr_info("#AC: crashing the kernel on kernel split_locks and sending SIGBUS on user-space split_locks\n");
-		} else if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT)) {
-			pr_info("#DB: sending SIGBUS on user-space bus_locks%s\n",
-				boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) ?
-				" from non-WB" : "");
-		}
+		else if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))
+			pr_info("#DB: sending SIGBUS on user-space bus_locks\n");
 		break;
 	case sld_ratelimit:
 		if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ