Subject: Re: [PATCH 1/2] powerpc/kdump: fix KASAN sanitization flag for core_$(BITS).o

From: Mahesh J Salgaonkar <[email-masked]>
Date: Mon, 23 Mar 2026 11:41:48 +0530

On 2026-03-21 11:01:17 Sat, Sourabh Jain wrote:
> KASAN instrumentation is intended to be disabled for the kexec core
> code, but the existing Makefile entry misses the object suffix. As a
> result, the flag is not applied correctly to core_$(BITS).o.
> 
> So when KASAN is enabled, kexec_copy_flush and copy_segments in
> kexec/core_64.c are instrumented, which can result in accesses to
> shadow memory via normal address translation paths. Since these run
> with the MMU disabled, such accesses may trigger page faults
> (bad_page_fault) that cannot be handled in the kdump path, ultimately
> causing a hang and preventing the kdump kernel from booting. The same
> is true for kexec as well, since the same functions are used there.
> 
> Update the entry to include the “.o” suffix so that KASAN
> instrumentation is properly disabled for this object file.
> 
> Fixes: 2ab2d5794f14 ("powerpc/kasan: Disable address sanitization in kexec paths")
> Reported-by: Venkat Rao Bagalkote <[email-masked]>
> Closes: https://lore.kernel.org/all/[email-masked]/
> Cc: Aboorva Devarajan <[email-masked]>
> Cc: Aditya Gupta <[email-masked]>
> Cc: Daniel Axtens <[email-masked]>
> Cc: Hari Bathini <[email-masked]>
> Cc: Madhavan Srinivasan <[email-masked]>
> Cc: Mahesh Salgaonkar <[email-masked]>
> Cc: Michael Ellerman <[email-masked]>
> Cc: Ritesh Harjani (IBM) <[email-masked]>
> Cc: Shivang Upadhyay <[email-masked]>
> Signed-off-by: Sourabh Jain <[email-masked]>
> ---
>  arch/powerpc/kexec/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kexec/Makefile b/arch/powerpc/kexec/Makefile
> index 470eb0453e17..ec7a0eed75dc 100644
> --- a/arch/powerpc/kexec/Makefile
> +++ b/arch/powerpc/kexec/Makefile
> @@ -16,4 +16,4 @@ GCOV_PROFILE_core_$(BITS).o := n
>  KCOV_INSTRUMENT_core_$(BITS).o := n
>  UBSAN_SANITIZE_core_$(BITS).o := n
>  KASAN_SANITIZE_core.o := n
> -KASAN_SANITIZE_core_$(BITS) := n
> +KASAN_SANITIZE_core_$(BITS).o := n

Nice catch. Thakns for fixing.

Acked-by: Mahesh Salgaonkar <[email-masked]>

Thanks,
-Mahesh.

-- 
Mahesh J Salgaonkar