Bug 724844

Summary: SELinux is preventing systemd-logind from 'getattr' accesses on the file /proc/<pid>/sessionid.
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:6367ab88727db5b962fa5801342cec47a513e0e7fef3276e8f3b0b7c3f061752
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-22 20:39:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jens Petersen 2011-07-22 00:50:24 UTC
SELinux is preventing systemd-logind from 'getattr' accesses on the file /proc/<pid>/sessionid.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that systemd-logind should be allowed getattr access on the sessionid 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 systemd-logind /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_logind_t:s0
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                /proc/<pid>/sessionid [ file ]
Source                        systemd-logind
Source Path                   systemd-logind
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-6.fc16
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              3.0-0.rc7.git3.1.fc16.x86_64 #1 SMP Fri Jul 15
                              22:56:12 UTC 2011 x86_64 x86_64
Alert Count                   4
First Seen                    Thu 21 Jul 2011 05:54:48 PM JST
Last Seen                     Fri 22 Jul 2011 09:48:11 AM JST
Local ID                      842c70c0-e006-4c60-bfb1-80a360fe5d1c

Raw Audit Messages
type=AVC msg=audit(1311295691.632:228): avc:  denied  { getattr } for  pid=721 comm="systemd-logind" path="/proc/11363/sessionid" dev=proc ino=40923 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=file


Hash: systemd-logind,systemd_logind_t,unconfined_t,file,getattr

audit2allow

#============= systemd_logind_t ==============
allow systemd_logind_t unconfined_t:file getattr;

audit2allow -R

#============= systemd_logind_t ==============
allow systemd_logind_t unconfined_t:file getattr;

Comment 1 Jens Petersen 2011-07-22 00:52:08 UTC
Above happens when running su in current Rawhide.

Comment 2 Miroslav Grepl 2011-07-22 10:22:15 UTC
Fixed in the next Rawhide release.

Comment 3 Miroslav Grepl 2011-07-22 16:39:32 UTC
Actually I also see

#============= systemd_logind_t ==============
allow systemd_logind_t unconfined_t:dbus send_msg;

Comment 4 Daniel Walsh 2011-07-22 20:39:48 UTC
Fixed in selinux-policy-3.10.0-9.fc16