pam_systemd is messing around with the given $DISPLAY, causing this AVC: > type=AVC msg=audit(1406027132.689:67802): avc: denied { search } for pid=4487 comm="tl-session" name=".X11-unix" dev="tmpfs" ino=18235 scontext=system_u:system_r:thinlinc_session_t:s0 tcontext=system_u:object_r:xdm_tmp_t:s0 tclass=dir Commenting out pam_systemd gets rid of the audit message.
Where did the thinlinc_session_t type come from? It is not something we ship? Looks like thinlinc ships their own policy, you have to work with them.
Yes, it is an external policy. I was in a rush and should have been clearer. The point was that I believe the auth_use_pam() macro needs to be adjusted as (apparently) some PAM modules now need more access to do their work.
Created attachment 928755 [details] Policy file for ThinLinc This is the policy that defines the thinlinc_session_t type, and also calls auth_login_pgm_domain() to indicate that it needs to be allowed to perform a login. (I was also unable to reset the assignee back properly :/)
What is it searching for in /tmp/.X11-unix? Adding this to auth_use_pam seems like it is streting it, since I am not sure pam is causing this AVC. Seems to be X Specific.
Well, I haven't dug around in pam_systemd to figure out what it's up to, but I assume that the triggering condition is that PAM_XDISPLAY is set. Perhaps pam_systemd tries to verify the X11 socket? Or add some root window properties? One question is why this isn't seen with anything shipped with Fedora. I suspect that only display managers have PAM_XDISPLAY set. And they most likely run in a context where they need access to X11 anyway. If you put the non-graphical portions of GDM in a different context, then you might see similar problems. tl-session is more specialised and more or less only does the login. (It also runs before the X server is started, so whatever pam_systemd is up to will probably fail. But that's a separate matter.)
Is the search all that is needed? Have you run in permissive mode, to see if it actually does any other access?
This is the only AVC I see, even in permissive mode.
d0c04a625cd235b9c362a4bc17acfc7e2c5aca52 fixes this in git.
commit d0c04a625cd235b9c362a4bc17acfc7e2c5aca52 Author: Dan Walsh <dwalsh> Date: Fri Aug 22 09:08:23 2014 -0400 Allow programs to use pam to search through user_tmp_t dires (/tmp/.X11-unix) https://github.com/selinux-policy/selinux-policy/commit/d0c04a625cd235b9c362a4bc17acfc7e2c5aca52
selinux-policy-3.12.1-182.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-182.fc20
Package selinux-policy-3.12.1-182.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-182.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-9819/selinux-policy-3.12.1-182.fc20 then log in and leave karma (feedback).
selinux-policy-3.12.1-182.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
Confirmed that the issue is solved. Thank you. :)
I spoke too soon. Not sure why the AVC didn't show up the first time. Still getting: > type=AVC msg=audit(1410275853.495:53011): avc: denied { search } for pid=8600 comm="tl-session" name=".X11-unix" dev="tmpfs" ino=18622 scontext=system_u:system_r:thinlinc_session_t:s0 tcontext=system_u:object_r:xdm_tmp_t:s0 tclass=dir selinux-policy-3.12.1-182.fc20.noarch selinux-policy-devel-3.12.1-182.fc20.noarch
Ah. The problem is that the X11 files are xdm_tmp_t, not normal tmp_t. You need a call to xserver_search_xdm_tmp_dirs() rather than userdom_search_user_tmp_dirs().
Ping?
We get it as user_tmp_t in F21. It needs to be allowed by thinlinc policy which we don't ship.
So F20 is already too old to be adjusted? $ ls -Z /tmp/.X11-unix/ srwxrwxrwx. root root system_u:object_r:xdm_tmp_t:s0 X0
Lukas, could you add a fix for f20? We want to have xserver_search_xdm_tmp_dirs() together with userdom_search_user_tmp_dirs() in F20.
commit d3b075499ae66359bfda64aec6d3ef881502c71f Author: Lukas Vrabec <lvrabec> Date: Mon Sep 29 12:56:34 2014 +0200 Allow programs to use pam to search through xdm_tmp_t dires. BZ (#1122013) https://github.com/selinux-policy/selinux-policy/commit/d3b075499ae66359bfda64aec6d3ef881502c71f
selinux-policy-3.12.1-188.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-188.fc20
Package selinux-policy-3.12.1-188.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-188.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-11932/selinux-policy-3.12.1-188.fc20 then log in and leave karma (feedback).
This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.