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

Make systemd_tmpfiles_t MLS trusted for lowering the level of files #1758

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

naokitnk
Copy link
Contributor

Need to make systemd_tmpfiles_t MLS trusted for lowering the level of files as the domain needs to lower the levels of device files when mls is used.

Specifically, systemd_tmpfiles_t needs to lower the sensitivity level of /dev/fuse from s15 to s0.

Note that another way we could consider is to change the default sensitivity level of /dev/fuse from s0 to s15 so that the sensitivity level does not need to be lowered from s15 to s0 in the first place. However, the default sensitivity level of /dev/fuse was intentionally changed from s15 (mls_systemhigh) to s0 in the following commit before. So, I don't understand changing it back to s15 (mls_systemhigh) is a good idea.

/dev/fuse should be s0 not mls_high
105e85a

@naokitnk
Copy link
Contributor Author

naokitnk commented Jul 7, 2023

Please let me know if you need additional clarifications from my side.

FYI, below is the corresponding error message in /var/log/messages this commit addresses.

audit: SELINUX_ERR op=security_validate_transition seresult=denied oldcontext=system_u:object_r:fuse_device_t:s15:c0.c1023 newcontext=system_u:object_r:fuse_device_t:s0 taskcontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 tclass=chr_file

I understand this is started being observed with mls when systemd-tmpfiles service started using /usr/lib/tmpfiles.d/static-nodes-permissions.conf to set permissions and security contexts of device files including /dev/fuse because of the following commit:

tmpfiles: override permissions of static nodes that need this
systemd/systemd@1f9290f

@zpytela
Copy link
Contributor

zpytela commented Jul 11, 2023

Please include the audit denial and the additional information in the commit.

Need to make systemd_tmpfiles_t MLS trusted for lowering the level of files
as the domain needs to lower the levels of device files when mls is used.

Specifically, systemd_tmpfiles_t needs to lower the sensitivity level of
/dev/fuse from s15 to s0.

This commit addresses the following error message in /var/log/messages:

audit: SELINUX_ERR op=security_validate_transition seresult=denied oldcontext=system_u:object_r:fuse_device_t:s15:c0.c1023 newcontext=system_u:object_r:fuse_device_t:s0 taskcontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 tclass=chr_file

I understand this is started being observed with mls when systemd-tmpfiles
service started using /usr/lib/tmpfiles.d/static-nodes-permissions.conf
to set permissions and security contexts of device files including /dev/fuse
because of the following commit:

tmpfiles: override permissions of static nodes that need this
systemd/systemd@1f9290f

Note that another option we could consider would be to change the default
sensitivity level of /dev/fuse from s0 to s15 so that the sensitivity level
does not need to be lowered from s15 to s0 in the first place.
However, the default sensitivity level of /dev/fuse was intentionally changed
from s15 (mls_systemhigh) to s0 in the following commit before.
Thus, changing it back to s15 (mls_systemhigh) would not be a good idea.

/dev/fuse should be s0 not mls_high
fedora-selinux@105e85a

Signed-off-by: Naoki Tanaka <naoki.tanaka@oracle.com>
@naokitnk
Copy link
Contributor Author

Please include the audit denial and the additional information in the commit.

done

@zpytela
Copy link
Contributor

zpytela commented Jul 12, 2023

Thank you. I know I keep bothering you, but the commit message is important especially from long-term perspective in commits like this.

@naokitnk
Copy link
Contributor Author

Thank you. I know I keep bothering you, but the commit message is important especially from long-term perspective in commits like this.

No problem at all. Could you merge this now that I have added the info to the commit message as you requested?

@zpytela
Copy link
Contributor

zpytela commented Jul 13, 2023

Sure, thank you.

@zpytela zpytela merged commit d98adbe into fedora-selinux:rawhide Jul 13, 2023
1 of 2 checks passed
@naokitnk naokitnk deleted the systemd branch July 13, 2023 20: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