[PATCH 2/2] kernel/kexec: Fix IMA when allocation happens in CMA area

Andrew Morton akpm at linux-foundation.org
Wed Nov 5 16:14:32 PST 2025


On Wed,  5 Nov 2025 21:09:22 +0800 Pingfan Liu <piliu at redhat.com> wrote:

> When I tested kexec with the latest kernel, I ran into the following warning:
> 
> [   40.712410] ------------[ cut here ]------------
> [   40.712576] WARNING: CPU: 2 PID: 1562 at kernel/kexec_core.c:1001 kimage_map_segment+0x144/0x198
> [...]
> [   40.816047] Call trace:
> [   40.818498]  kimage_map_segment+0x144/0x198 (P)
> [   40.823221]  ima_kexec_post_load+0x58/0xc0
> [   40.827246]  __do_sys_kexec_file_load+0x29c/0x368
> [...]
> [   40.855423] ---[ end trace 0000000000000000 ]---
> 
> This is caused by the fact that kexec allocates the destination directly
> in the CMA area. In that case, the CMA kernel address should be exported
> directly to the IMA component, instead of using the vmalloc'd address.

This is something we should backport into tearlier kernels.

> Signed-off-by: Pingfan Liu <piliu at redhat.com>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: Baoquan He <bhe at redhat.com>
> Cc: Alexander Graf <graf at amazon.com>
> Cc: Steven Chen <chenste at linux.microsoft.com>
> Cc: linux-integrity at vger.kernel.org
> To: kexec at lists.infradead.org

So I'm thinking we should add

Fixes: 0091d9241ea2 ("kexec: define functions to map and unmap segments")
Cc: <stable at vger.kernel.org>

yes?



More information about the kexec mailing list