Bug 14963 - KDE Plasma 5 could not sync to DBus
Summary: KDE Plasma 5 could not sync to DBus
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Nicolas Lécureuil
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 12:33 CET by Davide Nifosi
Modified: 2015-06-10 04:58 CEST (History)
8 users (show)

See Also:
Source RPM: plasma-workspace
CVE:
Status comment:


Attachments

Description Davide Nifosi 2015-01-06 12:33:18 CET
Description of problem:
Starting Plasma 5 fails after login, with a popup message "could not sync to DBus"; .xsession-errors reports same error and nothing else.

I believe this new version of DBus disallows a call that /usr/libexec/ksyncdbusenv (part of startkde) makes.

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


How reproducible: always


Steps to Reproduce:
1. Login to Plasma 5 with KDM
2. error popup appears
3. clicking OK restarts KDM


Reproducible: 

Steps to Reproduce:
Comment 1 Jüri Ivask 2015-01-06 13:43:51 CET
Do yo have dbus-x11 package installed?

CC: (none) => jyri2000

Comment 2 Davide Nifosi 2015-01-06 13:48:51 CET
Yes, dbus-x11-1.8.14-1.mga5.
Comment 3 Ãlo Parri 2015-01-06 18:59:06 CET
Same thing for me. I have built plasma 5 with kdesrc-build, but get the same message. 
IceWM seems to work.

I will check with mga packages.

CC: (none) => yltsparri

Comment 4 Ãlo Parri 2015-01-06 19:26:23 CET
Before updating mga packages worked. Ran urpmi --auto-update and got the same message without desktop.
David Walser 2015-01-06 20:01:39 CET

Assignee: bugsquad => mageia

Comment 5 Sander Lepik 2015-01-06 20:03:25 CET
http://kaosx.us/phpBB3/viewtopic.php?f=18&t=777

CC: (none) => mageia, tmb

Comment 6 Thomas Backlund 2015-01-06 20:48:57 CET
@Simon:

any thoughts on this?

I see Thiago Macieira from kde has reviewed the hardening patches, so maybe they are aware of the issues ?

CC: (none) => simon.mcvittie

Comment 7 Simon McVittie 2015-01-06 21:23:13 CET
If dbus 1.8.14 is denying messages, you will see messages this in the syslog or systemd Journal:

Jan 06 20:21:14 archetype dbus[967]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.527" (uid=1000 pid=5890 comm="dbus-send --system --dest=org.freedesktop.DBus --t") interface="com.example" member="Nope" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)

For the system bus, these messages go to the systemd Journal on systemd systems, or to the AUTHPRIV syslog (on Debian it's /var/log/auth.log).

For the session bus, these messages might either go to the systemd Journal or to ~/.xsession-errors or somewhere else.
Comment 8 Simon McVittie 2015-01-06 21:38:24 CET
> /usr/libexec/ksyncdbusenv

Yes, this falls foul of the hardening in 1.8.14:

QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"), QStringLiteral("/"), QStringLiteral("org.freedesktop.DBus"), QStringLiteral("UpdateActivationEnvironment"));

The canonical object path for the org.freedesktop.DBus pseudo-service is /org/freedesktop/DBus, although for historical reasons you can call its methods (except for UpdateActivationEnvironment and the Stats interface, since 1.8.14) on any object path. You can tell it's the canonical object path because that's where the NameOwnerChanged signal comes from.

Unfortunately, this is a newer version of KDE than is present in Debian, so my search on codesearch.debian.net indicated that nobody was using other paths for this particular method call.

The risk here is that on the system bus (which is a privilege boundary), incorrect access-control policies like the one resulting in CVE-2014-8148 might allow unauthorized users to call UpdateActivationEnvironment. I initially thought this was a root privilege escalation vulnerability; I now believe it's only a slow denial of service via eating up system dbus-daemon memory, because of some other paranoia in the service-activation code path, but any bug in this area of code is basically a recipe for privilege escalation, so it's a case of "better safe than sorry".

The major difference between the system bus and session bus is exactly the access-control policies, so it isn't trivial to mitigate this for the system bus without also affecting the session bus.

If necessary I can revert the filtering that requires UpdateActivationEnvironment to be called at /org/freedesktop/DBus, because there's an orthogonal mitigation in the same release (only allow UpdateActivationEnvironment to be called by the same uid of the dbus-daemon); but if at all possible I'd prefer to fix KDE instead, because, again, this area is the sort of place where privilege escalations happen, so the more layers of mitigation there are, the happier I am.
Comment 9 Simon McVittie 2015-01-06 21:39:48 CET
> my search on codesearch.debian.net indicated that nobody
> was using other paths for this particular method call

For instance, gnome-session has an example of a call to UpdateActivationEnvironment that does use "/org/freedesktop/DBus" instead of "/".
Comment 10 Davide Nifosi 2015-01-06 22:14:01 CET
Don't know if it matters anymore, but I haven't found any dbus reject messages in the journal, in .xsession-errors, or in any other file in /var/log. The DBus daemon is up and all the buses seem to be there (checked with qdbus)
Comment 11 Jüri Ivask 2015-01-08 09:50:04 CET
Does Wed Jan 7 12:28:57 2015 UTC dbus-1.8.14-2.mga5 update resolve that problem for Plasma5?
Comment 12 Davide Nifosi 2015-01-08 12:18:05 CET
No. I tested it anyway, but it was for an unrelated thing.
Comment 13 Ãlo Parri 2015-01-08 21:16:45 CET
I have some progress. 
After installig updates and rerunning kdesrc-build script my custom built plasma 5 desktop works. But Mageia packages continue to have the problem. Maybe some kde package needs rebuild?
Comment 15 Luc Menut 2015-01-08 23:57:40 CET
upstream patch backported

This should be fixed with plasma-workspace-5.1.2-7.mga5.

Status: NEW => RESOLVED
CC: (none) => lmenut
Resolution: (none) => FIXED
Source RPM: dbus => plasma-workspace

Comment 16 Thomas Backlund 2015-01-09 00:29:37 CET
Awesome, thanks Luc.
Comment 17 Gregory Seaborn 2015-02-16 21:03:07 CET
Where do I find that package to install from console in Failsafe mode.  KDE hangs boot, and when I do startkde I get the "Could not start D-Bus" message.

Thanks,
Greg

CC: (none) => gseaborn

Comment 18 Richard Giroux 2015-06-10 04:58:00 CEST
Hi,

I know this bug is marked as fixed but I am still stuck with it.
My plasma-workspace version is 5.1.2.9.mga5

I can start a failsafe window from SDDM and dbus-launch then startkde but plasma won't start from the DM menu.

Could you help me please.
Thanks,
Richard

CC: (none) => nrgiroux


Note You need to log in before you can comment on or make changes to this bug.