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: <20250326151204.67898-3-carlos.bilbao@kernel.org>
Date: Wed, 26 Mar 2025 10:12:04 -0500
From: carlos.bilbao@...nel.org
To: tglx@...utronix.de
Cc: bilbao@...edu,
	pmladek@...e.com,
	akpm@...ux-foundation.org,
	jan.glauber@...il.com,
	jani.nikula@...el.com,
	linux-kernel@...r.kernel.org,
	gregkh@...uxfoundation.org,
	takakura@...inux.co.jp,
	john.ogness@...utronix.de,
	Carlos Bilbao <carlos.bilbao@...nel.org>
Subject: [PATCH 2/2] x86/panic: Use safe_halt() for CPU halt after panic

From: Carlos Bilbao <carlos.bilbao@...nel.org>

Include an arch/x86-specific function to halt CPU once the kernel has
finished handling a panic, by defining the weak function
cpu_halt_after_panic().

Signed-off-by: Carlos Bilbao (DigitalOcean) <carlos.bilbao@...nel.org>
Reviewed-by: Jan Glauber (DigitalOcean) <jan.glauber@...il.com>
---
 arch/x86/kernel/Makefile | 1 +
 arch/x86/kernel/panic.c  | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 arch/x86/kernel/panic.c

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index f7918980667a..0e4d87596f5d 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -85,6 +85,7 @@ obj-y				+= stacktrace.o
 obj-y				+= cpu/
 obj-y				+= acpi/
 obj-y				+= reboot.o
+obj-y				+= panic.o
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_PCI)		+= early-quirks.o
diff --git a/arch/x86/kernel/panic.c b/arch/x86/kernel/panic.c
new file mode 100644
index 000000000000..0838bb7cf9a9
--- /dev/null
+++ b/arch/x86/kernel/panic.c
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+// Author Carlos Bilbao <carlos.bilbao@...nel.org>
+#include <linux/kernel.h>
+#include <asm/processor.h>
+
+void cpu_halt_after_panic(void)
+{
+	safe_halt();
+}
-- 
2.47.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ