Bug 2019905
| Summary: | If selinux labels are not restored, the autorelabel is not enough in RHEL8.4 and recovered system does not boot | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Welterlen Benoit <bwelterl> |
| Component: | rear | Assignee: | Pavel Cahyna <pcahyna> |
| Status: | ASSIGNED --- | QA Contact: | CS System Management SST QE <rhel-cs-system-management-subsystem-qe> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.4 | CC: | ovasik, pcahyna |
| Target Milestone: | rc | Flags: | ovasik:
needinfo?
(pcahyna) |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Welterlen Benoit
2021-11-03 15:37:24 UTC
Hello Benoit, I suppose that the issue does not happen with usual tar (NETFS), because I have not observed this in tests? With BACKUP=RSYNC, the issue does not occur either if the backup destination supports the appropriate extended attributes, or does it? Hello Pavel, Thanks for your answer. Yes, the issue is only seen when labels are not restored correctly (especially /etc/localtime). In this case, the .autorelabel is useless because it can't be applied, systemd is already dead. The solution is to boot with enforcing=0, but this seems complex, because it's a temporary option only for the first boot. I don't know if this is easily feasible (EFI can configure next entry, but legacy ...) Anyway, the relabel function should be fixed also. Thank you ! Benoit Yes, but I am curious if you know under which conditions this does or does not happen, because I thought that ReaR in general relies on relabeling, not restoration of labels - but apparently I was wrong. If you don't know, no problem, I will investigate. The root cause is that autorelabel can't be reliable anymore in RHEL8.4 because systemd is not able to access unlabelled files any more, and fails before the relabel if /etc/localtime is not labelled for example ! I opened this BZ against rear because I saw the issue with it, and wondering if the workaround can be automatically applied by rear, or at least a warning before the reboot: if at the end of the process, /etc/localtime is not labelled and selinux in enforcing, WARNING to run the first boot with enforcing=0 to allow the relabel. But I will also open a BZ against selinux to improve the autorelabel process. Thank you ! Hello, I opened a BZ against selinux, and it seems not possible to start autorelabel earlier: https://bugzilla.redhat.com/show_bug.cgi?id=2021835 The specific answer for rear will be to restore the labels before the first reboot: # setfiles -c /mnt/local/etc/selinux/target/policy/policy.32 -r /mnt/local/ /mnt/local/etc/selinux/targeted/contexts/files/file_contexts /mnt/local Thank you ! Benoit |