Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes #741

Merged
merged 12 commits into from
Jan 10, 2024
Merged

Various fixes #741

merged 12 commits into from
Jan 10, 2024

Conversation

0xC0ncord
Copy link
Contributor

@0xC0ncord 0xC0ncord commented Dec 18, 2023

Some various fixes including changes needed to fix new AVCs with systemd 255.

With this set of changes we also implement the proposed fix in #732.

If gluster ever experiences data corruption on its underlying bricks, a
situation may arise where the corrupted files have bad or missing
xattrs and are therefore presented as unlabeled to SELinux. Gluster will
then be unable to repair these files until the access is allowed or the
user manually relabels these files.

Signed-off-by: Kenton Groombridge <[email protected]>
Signed-off-by: Kenton Groombridge <[email protected]>
policy/modules/system/init.if Outdated Show resolved Hide resolved
policy/modules/kernel/kernel.te Outdated Show resolved Hide resolved
@@ -390,10 +390,14 @@ ifdef(`init_systemd',`
')

optional_policy(`
dev_getattr_generic_usb_dev(kernel_t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getattr is also provided by dev_delete_generic_usb_dev(kernel_t); see delete_chr_file_perms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. This is supposed to be setattr instead.

As of systemd 255, services are no longer forked from PID 1 but instead
are spawned by a new systemd-executor helper binary. Label this binary
accordingly and add a rule for systemd user session domains to use it.

Closes: SELinuxProject#732
Signed-off-by: Kenton Groombridge <[email protected]>
Signed-off-by: Kenton Groombridge <[email protected]>
Seems to be needed as of systemd 255 for writing to
/run/systemd/private.

Signed-off-by: Kenton Groombridge <[email protected]>
Add new required accesses for systemd-pcrphase and label the new
systemd-pcrextend under the same domain.

Signed-off-by: Kenton Groombridge <[email protected]>
Signed-off-by: Kenton Groombridge <[email protected]>
Fixes for su to allow writing to faillog, lastlog, and wtmp.

Signed-off-by: Kenton Groombridge <[email protected]>
Seen with systemd 255.

type=AVC msg=audit(1702835409.236:64): avc:  denied  { getattr } for  pid=178 comm="kdevtmpfs" path="/bsg/17:0:0:0" dev="devtmpfs" ino=350 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1702835409.236:65): avc:  denied  { setattr } for  pid=178 comm="kdevtmpfs" name="17:0:0:0" dev="devtmpfs" ino=350 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1702835409.236:66): avc:  denied  { unlink } for  pid=178 comm="kdevtmpfs" name="17:0:0:0" dev="devtmpfs" ino=350 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1702835409.496:69): avc:  denied  { getattr } for  pid=178 comm="kdevtmpfs" path="/bus/usb/001/002" dev="devtmpfs" ino=314 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:usb_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1702835409.496:70): avc:  denied  { setattr } for  pid=178 comm="kdevtmpfs" name="002" dev="devtmpfs" ino=314 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:usb_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1702835409.496:71): avc:  denied  { unlink } for  pid=178 comm="kdevtmpfs" name="002" dev="devtmpfs" ino=314 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:usb_device_t:s0 tclass=chr_file permissive=1

Signed-off-by: Kenton Groombridge <[email protected]>
@pebenito pebenito merged commit 9c3fca3 into SELinuxProject:main Jan 10, 2024
56 checks passed
@0xC0ncord 0xC0ncord deleted the various-20231217 branch January 10, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants