Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 510572 - SELinux rules for dbus and gconf
Summary: SELinux rules for dbus and gconf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard: sec-policy r3
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-17 16:43 UTC by Jason Zaman
Modified: 2014-08-01 21:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gconf dbus policy addition (gnome_gconfd_dbus.patch,1.59 KB, patch)
2014-05-20 15:14 UTC, Jason Zaman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Zaman gentoo-dev 2014-05-17 16:43:21 UTC
@swift:

This is somewhat related to the gnome_xdg_ patch discussed over IRC earlier but you
wanted a record of it,

gconf is part of gnome and used to store settings, it looks like applications can
not talk to the server over dbus but the policy does not allow it.

$ gconftool-2 -g /apps
Failed to get value for `/apps': Configuration server couldn't be contacted: D-BUS error: An SELinux policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender=":1.85" (uid=1000 pid=11876 comm="gconftool-2 -g /apps ") interface="org.gnome.GConf.Server" member="GetDefaultDatabase" error name="(unset)" requested_reply="0" destination="org.gnome.GConf" (uid=1000 pid=10906 comm="/usr/libexec/gconfd-2 ")

$ ls -laZ /usr/bin/gconftool-2 
-rwxr-xr-x. 1 root root staff_u:object_r:bin_t 67504 May  6 09:51 /usr/bin/gconftool-2*

$ ls -laZ /usr/libexec/gconfd-2
-rwxr-xr-x. 1 root root staff_u:object_r:gconfd_exec_t 51176 May  6 09:51 /usr/libexec/gconfd-2*

$ id -Z
staff_u:staff_r:staff_t

$ ps -efZ | grep gconf
staff_u:staff_r:gconfd_t        jason    10906     1  0 May16 ?        00:00:00 /usr/libexec/gconfd-2


-- Jason


Reproducible: Always
Comment 1 Jason Zaman gentoo-dev 2014-05-20 15:13:27 UTC
I managed to track down the denials.

May 20 18:02:46 pippin dbus[2244]: avc:  denied  { send_msg } for msgtype=method_call interface=org.gnome.GConf.Server member=GetDefaultDatabase dest=org.gnome.GConf spid=3717 tpid=2454 scontext=staff_u:staff_r:staff_t tcontext=staff_u:staff_r:gconfd_t tclass=dbus
May 20 18:04:57 pippin dbus[2244]: avc:  denied  { send_msg } for msgtype=method_return dest=:1.67 spid=2454 tpid=3760 scontext=staff_u:staff_r:gconfd_t tcontext=staff_u:staff_r:staff_t tclass=dbus

I am attaching a patch to the gnome policy which adds "gnome_dbus_chat_gconfd" and "gnome_dbus_chat_all_gconfd" which fixes the problem
Comment 2 Jason Zaman gentoo-dev 2014-05-20 15:14:34 UTC
Created attachment 377290 [details, diff]
gconf dbus policy addition

adds two interfaces to the gnome policy
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2014-05-22 17:13:24 UTC
I would use the gnome_dbus_chat_gconfd interface, but with the content you provided for the gnome_dbus_chat_all_gconfd interface. 

My reasoning for it is that
- the *_gconfd_t types are aliases for gconfd_t
- an "all_gconfd" would imply (to me) that *_gconfd_t domains have a common attribute (like "gconfd_domain") that would be used instead
Comment 4 Jason Zaman gentoo-dev 2014-05-22 17:24:54 UTC
(In reply to Sven Vermeulen from comment #3)
> I would use the gnome_dbus_chat_gconfd interface, but with the content you
> provided for the gnome_dbus_chat_all_gconfd interface. 

thats fine with me, having two interfaces seemed a bit superfluous anyway.

> My reasoning for it is that
> - the *_gconfd_t types are aliases for gconfd_t
> - an "all_gconfd" would imply (to me) that *_gconfd_t domains have a common
> attribute (like "gconfd_domain") that would be used instead

its called gconfd_t.

the relevant part of the policy is:
type gconfd_t, gnomedomain;
typealias gconfd_t alias { user_gconfd_t staff_gconfd_t sysadm_gconfd_t };
typealias gconfd_t alias { auditadm_gconfd_t secadm_gconfd_t };
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2014-05-28 18:07:33 UTC
Is in the live repo, will be part of rev 3
Comment 6 Sven Vermeulen (RETIRED) gentoo-dev 2014-05-29 20:10:06 UTC
r3 is in tree, ~arch
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2014-08-01 21:19:55 UTC
r3 is stabilized