24.5. Troubleshooting systemd failure to load the IMA policy
If systemd does not load /etc/ima/ima-policy, the system hangs and displays the error systemd[1]: Freezing execution.
[ 5.829882] ima: policy update failed
[ 5.830094] ima: signed policy file (specified as an absolute pathname) required
[!!!!!!] Failed to load IMA policy.
…
[ 5.859994] systemd[1]: Freezing execution.
There are three methods that you can use to recover your system.
24.5.1. Turn off Secure Boot リンクのコピーリンクがクリップボードにコピーされました!
If the policy cannot be loaded because it is not signed, you might see errors similar to the following examples.
[ 5.661906] ima: policy update failed
[ 5.662290] ima: signed policy file (specified as an absolute pathname) required
[ 5.662496] systemd[1]: Failed to load the IMA custom policy file /etc/ima/ima-policy1: Permission denied
[ 5.662663] ima: policy update failed
[ 5.662856] audit: type=1800 audit(1744968172.925:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 op=appraise_data cause=IMA-signature-required comm="systemd" name="/etc/ima/ima-policy" dev="vda3" ino=25679834 res=0 errno=0
[ 5.663205] audit: type=1802 audit(1744968172.925:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 op=policy_update cause=failed comm="systemd" res=0 errno=0
[!!!!!!] Failed to load IMA policy.
As a workaround, you can turn off Secure Boot temporarily and follow Deploying a custom signed IMA policy for UEFI systems to fix the issue.
24.5.2. Booting the system with the init=/bin/bash kernel parameter リンクのコピーリンクがクリップボードにコピーされました!
To boot the system with the init=/bin/bash kernel parameter, you can use the following steps.
-
Modify the bootloader entry and add the
init=/bin/bashkernel parameter. After you access the shell, remount the system with write permissions:
# mount -o remount,rw /Rename
/etc/ima/ima-policyto/etc/ima/ima-policy.bak:# mv /etc/ima/ima-policy /etc/ima/ima-policy.bakReboot the system:
# echo 1 > /proc/sys/kernel/sysrq # printf "s\nb" > /proc/sysrq-triggerResolve any issues in
/etc/ima/ima-policy.bakand verify that the policy can be loaded:# echo /etc/ima/ima-policy.bak >> /sys/kernel/security/integrity/ima/policyRename
/etc/ima/ima-policy.bakto/etc/ima/ima-policy:# mv /etc/ima/ima-policy.bak /etc/ima/ima-policy
24.5.3. Booting the system with the initcall_blacklist=init_ima kernel parameter リンクのコピーリンクがクリップボードにコピーされました!
If the system hangs with the error systemd[1]: Freezing execution, you can boot the system with the initcall_blacklist=init_ima kernel parameter to disable the IMA policy.
-
Modify the boot loader entry and add the
initcall_blacklist=init_imakernel parameter. Rename
/etc/ima/ima-policyto/etc/ima/ima-policy.bak:# mv /etc/ima/ima-policy /etc/ima/ima-policy.bakReboot the system:
# systemctl rebootResolve any issues in
/etc/ima/ima-policy.bakand verify that the policy can be loaded:# echo /etc/ima/ima-policy.bak >> /sys/kernel/security/integrity/ima/policyRename
/etc/ima/ima-policy.bakto/etc/ima/ima-policy:# mv /etc/ima/ima-policy.bak /etc/ima/ima-policy