-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Label /sys before selinux-autorelabel units run (bsc#1232709)
Addresses: Oct 31 08:19:17 localhost.localdomain kernel: audit: type=1400 audit(1730362757.524:6): avc: denied { read } for pid=1753 comm="restorecon" name="online" dev="sysfs" ino=45 scontext=system_u:system_r:setfiles_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=0
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Workaround for bsc#1232709 | ||
# | ||
# SELinux labels need to be set for certain /sys entries | ||
# before restorecon -T0 can be run by the selinux-autorelabel | ||
# generated unit files. | ||
# | ||
# The /sys entries that need to be labeled in advance are defined in: | ||
# /usr/lib/tmpfiles.d/selinux-policy.conf | ||
# | ||
# This can be removed in case systemd upstream adds /sys | ||
# to their mount_setup: | ||
# https://github.com/systemd/systemd/blob/bdf75118bade008b6a465173c02933eb377aef0d/src/shared/mount-setup.c#L407 | ||
|
||
[Unit] | ||
Description=Set correct SELinux labels in /sys | ||
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) | ||
|
||
DefaultDependencies=no | ||
Before=sysinit.target local-fs-pre.target systemd-udevd.service | ||
Wants=local-fs-pre.target | ||
Conflicts=shutdown.target initrd-switch-root.target | ||
Before=shutdown.target initrd-switch-root.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=systemd-tmpfiles --prefix=/sys --create --boot | ||
SuccessExitStatus=DATAERR CANTCREAT | ||
ImportCredential=tmpfiles.* |