Re: [PATCH v2 3/3] x86/kexec: Add a sanity check on previous kernel's ima kexec buffer

From: Mimi Zohar

Date: Tue Dec 30 2025 - 18:45:34 EST


On Mon, 2025-12-29 at 00:15 -0800, Harshit Mogalapalli wrote:
> When the second-stage kernel is booted via kexec with a limiting command
> line such as "mem=<size>", the physical range that contains the carried
> over IMA measurement list may fall outside the truncated RAM leading to
> a kernel panic.
>
> BUG: unable to handle page fault for address: ffff97793ff47000
> RIP: ima_restore_measurement_list+0xdc/0x45a
> #PF: error_code(0x0000) – not-present page
>
> Other architectures already validate the range with page_is_ram(), as
> done in commit cbf9c4b9617b ("of: check previous kernel's
> ima-kexec-buffer against memory bounds") do a similar check on x86.
>
> Without carrying the measurement list across kexec, the attestation
> would fail.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: b69a2afd5afc ("x86/kexec: Carry forward IMA measurement log on kexec")
> Reported-by: Paul Webb <paul.x.webb@xxxxxxxxxx>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
> ---
> V1-> V2: Added a line about carrying measure list across kexec based on
> suggestion from Mimi Zohar. Made use to the new generic helper
> [Suggestion from Borislav]

Thanks, Harshit.

Reviewed-by: Mimi Zohar <zohar@xxxxxxxxxxxxx>