Re: [PATCH] arm64: kexec: mark machine_kexec() __nocfi
From: sashiko-bot
Date: Thu Sep 24 2026 - 18:48:19 EST
> When the loaded image needs relocation, machine_kexec() makes an
> indirect call into the copy of arm64_relocate_new_kernel in the control
> page:
>
> kernel_reloc = (void *)kimage->arch.kern_reloc;
> kernel_reloc(kimage);
>
> With CONFIG_CFI=y the kCFI check on this call loads a type hash from
> kern_reloc - 4. arm64_relocate_new_kernel is SYM_CODE_START and carries
> no hash. Its copy also sits at the start of the control page, which is
> all that TTBR0 maps at this point, so the load faults and the kernel
> oopses after "Bye!" instead of entering the new kernel:
>
> Unable to handle kernel paging request at virtual address 00000000544bfffc
> Internal error: Oops: 0000000096000007 [#1] SMP
> [ ... ]
> ("x86/kexec: Mark machine_kexec() with __nocfi") did on x86.
>
> Fixes: efc2d0f20a9d ("arm64: kexec: keep MMU enabled during kexec relocation")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ben Cressey <ben@xxxxxxxxxxx>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924-arm64-kexec-nocfi-v1-1-bbae2e2eadc8@xxxxxxxxxxx?part=1