]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus_driver_handle_message: reject ActivationFailure if unprivileged
authorSimon McVittie <smcv@debian.org>
Fri, 7 Oct 2016 20:25:08 +0000 (21:25 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 10 Oct 2016 09:06:26 +0000 (10:06 +0100)
Specifically, this will allow ActivationFailure messages from our
own uid or from root, but reject them otherwise, even if the bus
configuration for who can own org.freedesktop.systemd1 is entirely
wrong due to something like CVE-2014-8148.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98157

bus/driver.c

index 01fd340fffcd00aba541c44786c44d66757ce4d9..660f04d983d6f5569857300a0cd8f4dbfc5a932f 100644 (file)
@@ -2616,6 +2616,15 @@ bus_driver_handle_message (DBusConnection *connection,
       BusContext *context;
       DBusConnection *systemd;
 
+      /* This is a directed signal, not a method call, so the log message
+       * is a little weird (it talks about "calling" ActivationFailure),
+       * but it's close enough */
+      if (!bus_driver_check_caller_is_privileged (connection,
+                                                  transaction,
+                                                  message,
+                                                  error))
+        return FALSE;
+
       context = bus_connection_get_context (connection);
       systemd = bus_driver_get_owner_of_name (connection,
           "org.freedesktop.systemd1");