Bug 1366731

Summary: SELinux prevents spice-vdagent to get property from systemd-logind
Product: Red Hat Enterprise Linux 7 Reporter: Victor Toso <victortoso>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde, victortoso
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-94.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 02:36:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1323623    

Description Victor Toso 2016-08-12 16:10:28 UTC
Description of problem:

We need to get the (boolean) "LockedHint" property from systemd-logind.


Version-Release number of selected component (if applicable):

selinux-policy-3.13.1-93.el7
spice-vdagent-0.14.0-14.el7
systemd-219-26.el7

How reproducible:
100%

Steps to Reproduce:
1. Use virt-manager or remote-viewer to connect to a RHEL7 guest
e.g: remote-viewer spice://localhost:5900
2. Drag a file from Client machine to the Guest
3. Run: journalctl -b | grep -i spice

Actual results:

Aug 12 17:49:41 localhost.localdomain spice-vdagentd[692]: Properties.Get failed (locked-hint) due An SELinux policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender=":1.7" (uid=0 pid=692 comm="/usr/sbin/spice-vdagentd ") interface="org.freedesktop.DBus.Properties" member="Get" error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=626 comm="/usr/lib/systemd/systemd-logind ")

Expected results:

No error message.

Additional info:

This property is vital to avoid functionally like drag and drop to work when the Guest is Locked.

See vdagent bug: https://bugzilla.redhat.com/show_bug.cgi?id=1323623
See systemd bug: https://bugzilla.redhat.com/show_bug.cgi?id=1335499
See gnome-shell bug: https://bugzilla.redhat.com/show_bug.cgi?id=1329803

Comment 1 Milos Malik 2016-08-12 16:29:13 UTC
Could you run following command and paste here its output?

# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today

Comment 2 Victor Toso 2016-08-12 16:36:32 UTC
(In reply to Milos Malik from comment #1)
> Could you run following command and paste here its output?
> 
> # ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today

[root@localhost toso]# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today
----
type=USER_AVC msg=audit(08/12/2016 17:43:40.934:174) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=signal interface=org.freedesktop.login1.Session member=Unlock dest=org.freedesktop.DBus spid=626 tpid=692 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:vdagent_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:43:56.298:180) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=signal interface=org.freedesktop.login1.Session member=Unlock dest=org.freedesktop.DBus spid=626 tpid=692 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:vdagent_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:45:21.698:193) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=method_call interface=org.freedesktop.DBus.Properties member=Get dest=org.freedesktop.login1 spid=692 tpid=626 scontext=system_u:system_r:vdagent_t:s0 tcontext=system_u:system_r:systemd_logind_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:49:41.623:204) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=method_call interface=org.freedesktop.DBus.Properties member=Get dest=org.freedesktop.login1 spid=692 tpid=626 scontext=system_u:system_r:vdagent_t:s0 tcontext=system_u:system_r:systemd_logind_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:49:46.601:209) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=signal interface=org.freedesktop.login1.Session member=Unlock dest=org.freedesktop.DBus spid=626 tpid=692 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:vdagent_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:50:32.342:237) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=method_call interface=org.freedesktop.DBus.Properties member=Get dest=org.freedesktop.login1 spid=692 tpid=626 scontext=system_u:system_r:vdagent_t:s0 tcontext=system_u:system_r:systemd_logind_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 17:50:32.343:238) : pid=622 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { 0x2 } for msgtype=method_return dest=:1.7 spid=626 tpid=692 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:vdagent_t:s0 tclass=(null)  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(08/12/2016 18:00:01.209:260) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  received setenforce notice (enforcing=0)  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?'

Comment 3 Milos Malik 2016-08-12 16:55:40 UTC
Based on the output, following rules are missing in the selinux-policy:

allow vdagent_t systemd_logind_t : dbus { send_msg };
allow systemd_logind_t vdagent_t : dbus { send_msg };

Comment 8 errata-xmlrpc 2016-11-04 02:36:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2283.html