On Thu, 2026-09-24 at 16:34 -0700, Danny Hu wrote: > Hello, > > I have a question about the intended security properties of IMA > appraisal across kexec_file_load(). I am trying to understand why IMA > supports appraisal of the kexec kernel and initramfs through > KEXEC_KERNEL_CHECK and KEXEC_INITRAMFS_CHECK, while KEXEC_CMDLINE is > measurement-only and cannot reject an unauthorized target command > line. Requiring a signer-approved kernel implies that CAP_SYS_BOOT > alone is not sufficient authority to boot a target kernel. Then why > are command-line parameters capable of weakening the target kernel’s > enforcement state not similarly bound to the signer’s approval? > > This appears to leave a gap when IMA is the mechanism enforcing kexec > integrity. A caller permitted to perform kexec could use the signed > kernel as a downgrade trampoline: > > 1. Supply an approved, signed kernel and initramfs. > 2. Supply an unauthenticated command line that prevents IMA > enforcement in the target kernel. An example of such is through > “initcall_blacklist=init_ima”. > 3. Boot into the approved kernel without effective IMA enforcement. > 4. An attacker is then free to execute unsigned code or kexec into any > other unsigned kernel. > > A few questions for the IMA maintainers: > > - Is the lack of KEXEC_CMDLINE appraisal simply an architectural > constraint of IMA’s inode-based appraisal model, or an intentional > part of the security model? > - Is command-line integrity expected to be provided by another subsystem? > - Have there been any discussions around a concept of “IMA continuity” > across kexec? By continuity, I mean preserving the appraisal invariant > across the transition so that every accepted target kernel > re-establishes equivalent enforcement. > - If policy continuity was not intended, what threat model gives > appraisal of the kernel and initramfs its intended security value when > their execution environment can be weakened through an unauthenticated > command line? > > Thank you for any historical context or guidance on the intended design!
The lack of KEXEC_CMDLINE appraisal is an architectural constraint of IMA's inode-based appraisal model. The kexec command line is a plain buffer passed directly to kexec_file_load() via syscall. Unlike the kernel image or initramfs, it is not a file. There is no natural way to associate a signature with it, whether via xattr or as an appended signature. This is not an intentional security decision but a consequence of how IMA appraisal works. The threat model concern you raise is valid — a caller with access to kexec_file_load() can supply an unauthenticated command line that weakens the target kernel's enforcement state, even when the kernel and initramfs are appraised. This gap is real and currently unaddressed. IMA continuity across kexec has not been discussed. Appraising the kernel image and initramfs does not guarantee the target kernel will enforce an equivalent IMA policy after boot. We would welcome proposals for addressing these gaps. Mimi
