Bug 808952

Summary: SELinux is preventing /usr/lib/systemd/systemd-multi-seat-x from 'write' accesses on the directory systemd.
Product: [Fedora] Fedora Reporter: shawnlandden
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, jerome, lpoetter, mgrepl, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: abrt_hash:8848ed33c64e232985a1289b97349ccb107f665442f40522e3d6e37710414b14
Fixed In Version: selinux-policy-3.10.0-116.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-18 23:07:32 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 shawnlandden 2012-04-02 00:40:08 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.0-1.fc17.x86_64
reason:         SELinux is preventing /usr/lib/systemd/systemd-multi-seat-x from 'write' accesses on the directory systemd.
time:           Sun 01 Apr 2012 01:39:27 PM EDT

description:
:SELinux is preventing /usr/lib/systemd/systemd-multi-seat-x from 'write' accesses on the directory systemd.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that systemd-multi-seat-x should be allowed write access on the systemd directory 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-multi-s /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                systemd [ dir ]
:Source                        systemd-multi-s
:Source Path                   /usr/lib/systemd/systemd-multi-seat-x
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           systemd-44-1.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-104.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux localhost.localdomain 3.3.0-1.fc17.x86_64 #1
:                              SMP Mon Mar 19 03:03:39 UTC 2012 x86_64 x86_64
:Alert Count                   6
:First Seen                    Sun 01 Apr 2012 01:29:54 PM EDT
:Last Seen                     Sun 01 Apr 2012 01:29:54 PM EDT
:Local ID                      2d54cc3a-343a-44b7-95df-bd3417bc48c3
:
:Raw Audit Messages
:type=AVC msg=audit(1333301394.950:323): avc:  denied  { write } for  pid=1638 comm="systemd-multi-s" name="systemd" dev="tmpfs" ino=7589 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1333301394.950:323): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=4034a6 a1=1ed a2=7fab10ea5770 a3=7ffffeca6640 items=0 ppid=1636 pid=1638 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-multi-s exe=/usr/lib/systemd/systemd-multi-seat-x subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)
:
:Hash: systemd-multi-s,xdm_t,init_var_run_t,dir,write
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-04-02 19:58:50 UTC
Any idea what directory/file it is trying to write?  Is this writing content into /run/systemd

Comment 2 Daniel Walsh 2012-04-02 20:00:11 UTC
/run/systemd/multi-session-x/
/run/systemd/multi-session-x
/run/plymouth/pid


Systemd guys what processess have to be able to write here?  Read Hear?

Comment 3 Daniel Walsh 2012-04-02 20:02:58 UTC
Currently we have

/var/run/systemd/seats(/.*)?	gen_context(system_u:object_r:systemd_logind_var_run_t,s0)
/var/run/systemd/sessions(/.*)?	gen_context(system_u:object_r:systemd_logind_sessions_t,s0)
/var/run/systemd/users(/.*)?	gen_context(system_u:object_r:systemd_logind_var_run_t,s0)

Should we label multi-session-x the same?  Should we treat  systemd-multi-seat-x 
 like we treat /lib/systemd/systemd-logind

Comment 4 shawnlandden 2012-04-02 20:27:09 UTC
> Any idea what directory/file it is trying to write?  Is this writing content
into /run/systemd
yes
http://cgit.freedesktop.org/systemd/systemd/tree/src/login/multi-seat-x.c#n115

Comment 5 shawnlandden 2012-04-02 20:57:39 UTC
> Should we label multi-session-x the same?  Should we treat 
> systemd-multi-seat-x 
> like we treat /lib/systemd/systemd-logind

multi-seat-x is its own executable, and is an ugly wrapper around X until X gains this functionality natively

I dont think it needs access to the rules you listed above. The X server does need read access to the xorg.conf this wrapper writes out

Comment 6 Daniel Walsh 2012-04-09 20:42:18 UTC
Ok I am going to label this as xdm_var_run_t.

/var/run/systemd/multi-session-x(/.*)? gen_context(system_u:object_r:xdm_var_ru
 

And allow xdm_t to create it.  Does anything in systemd need to manage this directory?

Comment 7 Lennart Poettering 2012-04-11 13:25:30 UTC
multi-seat-x writes a throw-away configuration file for X to add graphics multi-seat support to X until X learns this natively.

Comment 8 shawnlandden 2012-04-11 20:09:12 UTC
> And allow xdm_t to create it.  Does anything in systemd need to manage this
directory?

no

Comment 9 Daniel Walsh 2012-04-13 17:56:24 UTC
Fixed in selinux-policy-3.10.0-114.fc17

Comment 10 Fedora Update System 2012-04-16 21:28:15 UTC
selinux-policy-3.10.0-116.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-116.fc17

Comment 11 Fedora Update System 2012-04-18 23:07:32 UTC
selinux-policy-3.10.0-116.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.