-
Bug
-
Resolution: Done-Errata
-
Major
-
rhel-8.8.0, rhel-9.2.0
-
None
-
anaconda-34.25.5.5-1.el9
-
None
-
Moderate
-
1
-
rhel-sst-installer
-
ssg_front_door
-
12
-
1
-
False
-
-
Yes
-
Red Hat Enterprise Linux
-
CCS 2024-15
-
Pass
-
None
-
Known Issue
-
-
Done
-
None
What were you trying to do that didn't work?
Please provide the package NVR for which bug is seen:
How reproducible:
Always
Steps to reproduce
- switch to SELinux MLS policy - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/using-multi-level-security-mls_using-selinux#switching-the-selinux-policy-to-mls_using-multi-level-security-mls
- Boot the RHEL9.2 DVD in Troubleshooting
- Choose rescue a RHEL system
- 1) Continue and hit Enter to get a shell
- reboot
Expected results
Actual results
Anaconda rescue mode creates /mnt/sysroot/.autorelabel in order to trigger selinux autorelabel mechanism - https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/rescue.py#L209
After reboot, the system boots mls in enforcing; and in mls (which is supposed to be strict policy) init_t is not allowed to switch to permissive on its own:
[ 3.864771] audit: type=1400 audit(1697479290.335:6): avc: denied { setenforce } for pid=716 comm="selinux-autorel" scontext=system_u:system_r:init_t:s0-s15:c0.c1023 tcontext=system_u:object_r:security_t:s15:c0.c1023 tclass=security permissive=0 [ 3.868487] selinux-autorelabel[716]: /usr/libexec/selinux/selinux-autorelabel: line 37: echo: write error: Permission denied
and therefore it can't later remove /.autorelabel and system goes to endless reboot loop until users add `enforcing=0` to kernel command line.
The following shell snippet would fix labeling issues directly in the rescue shell without need to trigger autorelabel:
source /mnt/sysroot/etc/selinux/config setfiles -c /mnt/sysroot/etc/selinux/$SELINUXTYPE/policy/policy.33 -r /mnt/sysroot /mnt/sysroot/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts /mnt/sysroot
- is cloned by
-
RHEL-38389 RHEL-10: "Rescue a RHEL system" causes endless reboot loop when system uses "mls" policy
- Release Pending
- links to
-
RHBA-2024:130339 anaconda bug fix and enhancement update