Thread (10 messages) 10 messages, 4 authors, 2026-04-02
STALE118d

[PATCH 2/2] powerpc/kexec: Disable KASAN for VMX helpers used in MMU-off path

From: Sourabh Jain <hidden>
Date: 2026-03-21 05:31:58
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

The kexec sequence invokes enter_vmx_ops() and exit_vmx_ops() with the
MMU disabled. In this context, code must not rely on normal virtual
address translations or trigger page faults.

With KASAN enabled, these functions get instrumented and may access
shadow memory using regular address translation. When executed with
the MMU off, this can lead to page faults (bad_page_fault) from which
the kernel cannot recover in the kexec path, resulting in a hang.

Mark enter_vmx_ops() and exit_vmx_ops() with __no_sanitize_address to
avoid KASAN instrumentation and ensure kexec boots fine with KASAN
enabled.

Cc: Aditya Gupta <redacted>
Cc: Daniel Axtens <redacted>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: Shivang Upadhyay <redacted>
Cc: Venkat Rao Bagalkote <redacted>
Reported-by: Aboorva Devarajan <redacted>
Signed-off-by: Sourabh Jain <redacted>
---
 arch/powerpc/lib/vmx-helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/vmx-helper.c b/arch/powerpc/lib/vmx-helper.c
index 554b248002b4..c01b2d856650 100644
--- a/arch/powerpc/lib/vmx-helper.c
+++ b/arch/powerpc/lib/vmx-helper.c
@@ -52,7 +52,7 @@ int exit_vmx_usercopy(void)
 }
 EXPORT_SYMBOL(exit_vmx_usercopy);
 
-int enter_vmx_ops(void)
+int __no_sanitize_address enter_vmx_ops(void)
 {
 	if (in_interrupt())
 		return 0;
@@ -69,7 +69,7 @@ int enter_vmx_ops(void)
  * passed a pointer to the destination which we return as required by a
  * memcpy implementation.
  */
-void *exit_vmx_ops(void *dest)
+void __no_sanitize_address *exit_vmx_ops(void *dest)
 {
 	disable_kernel_altivec();
 	preempt_enable();
-- 
2.52.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help