Bug 819347

Summary: SELinux is preventing /usr/libexec/gdm-session-worker from 'read' accesses on the file nologin.
Product: [Fedora] Fedora Reporter: troilimathieu
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl, mhlavink, mschmidt, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e964ac6fc5b540dadb74e01ce3627bfdb6263d19e659b6dd5e7aaea37d4ed510
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-28 01:19:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description troilimathieu 2012-05-06 19:12:02 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.4-4.fc17.x86_64
time:           dim. 06 mai 2012 21:12:34 CEST

description:
:SELinux is preventing /usr/libexec/gdm-session-worker from 'read' accesses on the file nologin.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that gdm-session-worker should be allowed read access on the nologin file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep gdm-session-wor /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:init_var_run_t:s0
:Target Objects                nologin [ file ]
:Source                        gdm-session-wor
:Source Path                   /usr/libexec/gdm-session-worker
:Port                          <Inconnu>
:Host                          (removed)
:Source RPM Packages           gdm-3.4.1-1.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-121.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.4-4.fc17.x86_64 #1 SMP Fri
:                              May 4 17:25:07 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    dim. 06 mai 2012 19:43:22 CEST
:Last Seen                     dim. 06 mai 2012 19:43:22 CEST
:Local ID                      39f4e920-562b-42d9-adf5-3c51be29fd67
:
:Raw Audit Messages
:type=AVC msg=audit(1336326202.712:343): avc:  denied  { read } for  pid=13122 comm="gdm-session-wor" name="nologin" dev="tmpfs" ino=496260 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1336326202.712:343): arch=x86_64 syscall=open success=no exit=EACCES a0=7f12fd2d6d22 a1=0 a2=0 a3=0 items=0 ppid=13103 pid=13122 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=gdm-session-wor exe=/usr/libexec/gdm-session-worker subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)
:
:Hash: gdm-session-wor,xdm_t,init_var_run_t,file,read
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Miroslav Grepl 2012-05-07 12:58:10 UTC
If you execute

# restorecon -R -v /etc/nologin

Are you able to reproduce it again?

Comment 2 Daniel Walsh 2012-05-07 14:42:03 UTC
Is there a new nologin file being created by systemd?

Comment 3 Michal Schmidt 2012-05-07 20:00:06 UTC
pam_nologin.so prefers /var/run/nologin since:

2010-08-26 Tomas Mraz <t8m@…>

    modules/pam_nologin/pam_nologin.c (perform_check): Try first /var/run/nologin if the nologin file is not explicitly specified.
    modules/pam_nologin/pam_nologin.8.xml: Document that /var/run/nologin is tried first. 


/var/run is a symlink to /run.

The "systemd-user-sessions" helper program creates /run/nologin when systemd-user-sessions.service is stopping.
The "systemd-shutdownd" daemon creates /run/nologin at 5 minutes before a scheduled shutdown.

Comment 4 Daniel Walsh 2012-05-07 20:37:25 UTC
Ok I guess we can label this systemd_login_var_run_t.  Does apcupsd use this path now?

Comment 5 Daniel Walsh 2012-05-07 20:41:59 UTC
Fixed in selinux-policy-3.10.0-123.fc17

Comment 6 Fedora Update System 2012-05-09 15:17:25 UTC
selinux-policy-3.10.0-124.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-124.fc17

Comment 7 Fedora Update System 2012-05-17 22:57:30 UTC
Package selinux-policy-3.10.0-125.fc17:
* should fix your issue,
* was pushed to the Fedora 17 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.10.0-125.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-7953/selinux-policy-3.10.0-125.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-05-28 01:19:54 UTC
selinux-policy-3.10.0-125.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.