| Summary: | D-Bus policies are not properly applied | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jussi Kukkonen <jku> |
| Component: | configuration | Assignee: | Jussi Kukkonen <jku> |
| Status: | VERIFIED FIXED | QA Contact: | Cristian Iorga <cristian.iorga> |
| Severity: | normal | ||
| Priority: | High | CC: | alexandru.c.georgescu, cristian.iorga, ross.burton |
| Version: | unspecified | ||
| Target Milestone: | 2.0 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Jussi Kukkonen
2015-09-29 08:36:47 UTC
A more useful test command (with actual results on qemu as well):
dbus-send --system --print-reply \
--dest=net.connman \
/net/connman/technology/ethernet \
net.connman.Technology.GetProperties
I think it's bluetooth.conf.
<policy context="default">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
<allow send_type="method_call"/>
</policy>
I think the person writing this thought the allow rules are somehow combined: they are not, so this is ... not optimal: It allows anyone to own org.bluez on system bus and it allows anyone to send messages to anyone on system bus.
I'm not sure but I think the reason it happened to work once with systemd is that the order of applying rules seems non-deterministic: sometimes, connmans rule seems to override this one. This feels like dbus-daemon bug (even if the service-specific configuration files aren't supposed to do things like the example here).
Jussi has been digging into this, so reassigning back to him. commit cdaa8fd9608d1c34a2e6c9f6d0c9dc6ced706859 Author: Jussi Kukkonen <jussi.kukkonen@intel.com> Date: Thu Oct 1 11:04:35 2015 +0300 bluez5: Use upstream D-Bus policy The Bluez D-Bus policy is much too open and affects not just bluez but all system services: Use upstream policy configuration instead. This change has a chance of affecting other D-Bus services: the bug that is fixed here may have hidden problems in other policies. [YOCTO #8414] (From OE-Core rev: 0f6f87c60a6ffeff6b3f53d25f4023749103e262) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Tested by adding a user named ubik and by executing:
ubik@qemux86-64:~$ dbus-send --system --print-reply --dest=net.connman /net/connman/technology/ethernet net.connman.Technology.GetProperties
Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.13" (uid=1001 pid=934 comm="dbus-send --system --print-reply --dest=net.connma") interface="net.connman.Technology" member="GetProperties" error name="(unset)" requested_reply="0" destination="net.connman" (uid=0 pid=697 comm="/usr/sbin/connmand ")
ubik@qemux86-64:~$ exit
exit
root@qemux86-64:~# dbus-send --system --print-reply --dest=net.connman /net/connman/technology/ethernet net.connman.Technology.GetProperties
method return sender=:1.0 -> dest=:1.14 reply_serial=2
array [
dict entry(
string "Name"
variant string "Wired"
)
dict entry(
string "Type"
variant string "ethernet"
)
dict entry(
string "Powered"
variant boolean true
)
dict entry(
string "Connected"
variant boolean false
)
dict entry(
string "Tethering"
variant boolean false
)
]
root@qemux86-64:~#
For non-root ubik user, the system errors out a denied access.
|