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

Two util-linux denials on Fedora Rawhide #2227

Open
DaanDeMeyer opened this issue Jul 11, 2024 · 8 comments
Open

Two util-linux denials on Fedora Rawhide #2227

DaanDeMeyer opened this issue Jul 11, 2024 · 8 comments

Comments

@DaanDeMeyer
Copy link
Contributor

DaanDeMeyer commented Jul 11, 2024

Jul 11 11:22:51 localhost audit[585]: AVC avc:  denied  { read } for  pid=585 comm="agetty" name="agetty.autologin" dev="tmpfs" ino=2 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass>
Jul 11 11:22:51 localhost audit[585]: AVC avc:  denied  { open } for  pid=585 comm="agetty" path="/run/credentials/[email protected]/agetty.autologin" dev="tmpfs" ino=2 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext>
Jul 11 11:22:51 localhost audit[584]: AVC avc:  denied  { read } for  pid=584 comm="login" name="login.noauth" dev="tmpfs" ino=3 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclas>
Jul 11 11:22:51 localhost audit[585]: AVC avc:  denied  { open } for  pid=585 comm="login" path="/run/credentials/[email protected]/login.noauth" dev="tmpfs" ino=3 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontex>
~

In the latest util-linux release, agetty and login will read systemd credentials to allow configuring their behavior. Reading the credentials should be allowed by the policy.

To reproduce:

git clone https://github.com/systemd/mkosi
cd mkosi
sudo bin/mkosi -d fedora -r rawhide -p selinux-policy-targeted --selinux-relabel=yes -t disk --tools-tree -f qemu
journalctl -g AVC
@zpytela
Copy link
Contributor

zpytela commented Jul 17, 2024

@DaanDeMeyer The logs are trimmed. It would be even more helpful if there were audit logs with full auditing enabled. The above reproducer seems not to be complete, so I cannot investigate further.

@DaanDeMeyer
Copy link
Contributor Author

@zpytela Apologies, these are the non-truncated logs, not with full auditing enabled though, I need to work on getting that enabled:

Jul 17 22:28:09 localhost audit[581]: AVC avc:  denied  { read } for  pid=581 comm="agetty" name="agetty.autologin" dev="tmpfs" ino=2 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file permissive=0
Jul 17 22:28:09 localhost audit[580]: AVC avc:  denied  { read } for  pid=580 comm="agetty" name="agetty.autologin" dev="tmpfs" ino=3 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file permissive=0

@zpytela
Copy link
Contributor

zpytela commented Jul 17, 2024

np, but can you add a functional reproducer or additional information - what path is the agetty.autologin file and which service creates it?

edit:
now i see it's /run/credentials/[email protected]/agetty.autologin and /run/credentials/[email protected]/login.noauth
reproducer would really be helpful

@DaanDeMeyer
Copy link
Contributor Author

np, but can you add a functional reproducer or additional information - what path is the agetty.autologin file and which service creates it?

edit:
now i see it's /run/credentials/[email protected]/agetty.autologin and /run/credentials/[email protected]/login.noauth
reproducer would really be helpful

The mkosi reproducer is not sufficient? I have some local logic that allows building and installing new selinux-policy rpms from source into the mkosi image if that makes life easier. Though it's awfully slow because the spec calls make clean all over the place.

@zpytela
Copy link
Contributor

zpytela commented Jul 18, 2024

In selinux-policy specfile I see make clean once in the install phase which imho is correct.

@DaanDeMeyer
Copy link
Contributor Author

In selinux-policy specfile I see make clean once in the install phase which imho is correct.

It probably is but it does make incremental builds using rpmbuild --build-in-place impossible so one has to wait a very long time between builds.

@DaanDeMeyer
Copy link
Contributor Author

@zpytela Anything I can do to make debugging this easier for you?

@zpytela
Copy link
Contributor

zpytela commented Jul 26, 2024

Yes, a simple reproducer. mkosi did not work for me for some reason. I'll give it another go.

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

No branches or pull requests

2 participants