summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dbus/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/dbus/dbus')
-rw-r--r--meta/recipes-core/dbus/dbus/CVE-2015-0245-prevent-forged-ActivationFailure.patch48
-rw-r--r--meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch104
-rw-r--r--meta/recipes-core/dbus/dbus/dbus-1.init123
-rw-r--r--meta/recipes-core/dbus/dbus/os-test.patch35
-rw-r--r--meta/recipes-core/dbus/dbus/python-config.patch25
-rwxr-xr-xmeta/recipes-core/dbus/dbus/run-ptest10
-rw-r--r--meta/recipes-core/dbus/dbus/tmpdir.patch44
7 files changed, 389 insertions, 0 deletions
diff --git a/meta/recipes-core/dbus/dbus/CVE-2015-0245-prevent-forged-ActivationFailure.patch b/meta/recipes-core/dbus/dbus/CVE-2015-0245-prevent-forged-ActivationFailure.patch
new file mode 100644
index 0000000000..59363b3e76
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/CVE-2015-0245-prevent-forged-ActivationFailure.patch
@@ -0,0 +1,48 @@
1CVE-2015-0245: prevent forged ActivationFailure from non-root processes
2
3Upstream has fixed this in code but suggests using this as a easily
4backportable fix: https://bugs.freedesktop.org/show_bug.cgi?id=88811
5
6Upstream-Status: Inappropriate
7Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
8
9
10
11From 91eb2ea3362630190e08c1c777c47bae065ac828 Mon Sep 17 00:00:00 2001
12From: Simon McVittie <simon.mcvittie@collabora.co.uk>
13Date: Mon, 26 Jan 2015 20:09:56 +0000
14Subject: [PATCH 1/3] CVE-2015-0245: prevent forged ActivationFailure from
15 non-root processes
16
17Without either this rule or better checking in dbus-daemon, non-systemd
18processes can make dbus-daemon think systemd failed to activate a system
19service, resulting in an error reply back to the requester.
20
21This is redundant with the fix in the C code (which I consider to be
22the real solution), but is likely to be easier to backport.
23---
24 bus/system.conf.in | 8 ++++++++
25 1 file changed, 8 insertions(+)
26
27diff --git a/bus/system.conf.in b/bus/system.conf.in
28index 92f4cc4..851b9e6 100644
29--- a/bus/system.conf.in
30+++ b/bus/system.conf.in
31@@ -68,6 +68,14 @@
32 <deny send_destination="org.freedesktop.DBus"
33 send_interface="org.freedesktop.DBus"
34 send_member="UpdateActivationEnvironment"/>
35+ <deny send_destination="org.freedesktop.DBus"
36+ send_interface="org.freedesktop.systemd1.Activator"/>
37+ </policy>
38+
39+ <!-- Only systemd, which runs as root, may report activation failures. -->
40+ <policy user="root">
41+ <allow send_destination="org.freedesktop.DBus"
42+ send_interface="org.freedesktop.systemd1.Activator"/>
43 </policy>
44
45 <!-- Config files are placed here that among other things, punch
46--
472.1.4
48
diff --git a/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
new file mode 100644
index 0000000000..6bb6d9c82e
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
@@ -0,0 +1,104 @@
1From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Thu, 27 Feb 2014 09:05:02 +0800
4Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd
5 failed
6
7Upstream-Status: Submitted
8
9bus-test dispatch test failed with below information:
10 ./bus/bus-test: Running message dispatch test
11 Activating service name='org.freedesktop.DBus.TestSuiteEchoService'
12 Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService'
13 6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok
14 ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969]
15 ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44]
16 ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3]
17 ./bus/bus-test() [0x80e24da]
18 ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848]
19 ./bus/bus-test() [0x80aea49]
20 ./bus/bus-test() [0x80affde]
21 ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841]
22 ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174]
23 ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8]
24 ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509]
25 ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d]
26 ./bus/bus-test() [0x806cab0]
27 ./bus/bus-test() [0x806e0ca]
28 ./bus/bus-test() [0x806da6f]
29 ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c]
30 ./bus/bus-test() [0x806f723]
31 ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac]
32 ./bus/bus-test(main+0x1b7) [0x805acc7]
33 /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3]
34 ./bus/bus-test() [0x805ae39]
35
36The stack is below:
37 #0 0xffffe425 in __kernel_vsyscall ()
38 #1 0x45fa62d6 in raise () from /lib/libc.so.6
39 #2 0x45fa9653 in abort () from /lib/libc.so.6
40 #3 0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94
41 #4 0x080b52c3 in _dbus_real_assert (condition=0,
42 condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
43 file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545,
44 func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok")
45 data=0x8157290) at dbus-connection.c:1515
46 #0 0x00000033fee353e9 in raise () from /lib64/libc.so.6
47 #1 0x00000033fee38508 in abort () from /lib64/libc.so.6
48 #2 0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94
49 #3 0x0000000000466486 in _dbus_real_assert (condition=<optimized out>,
50 condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
51 file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546,
52 func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok")
53 at dbus-internals.c:931
54 #4 0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480,
55 auth=0x6ff340) at dbus-auth.c:1546
56 #5 handle_client_state_waiting_for_data (auth=0x6ff340,
57 command=<optimized out>, args=0x7fffffffe480) at dbus-auth.c:1996
58 #6 0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208
59 #7 _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458
60 #8 0x000000000046091d in do_authentication (
61 transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1,
62 do_writing=do_writing@entry=0,
63 auth_completed=auth_completed@entry=0x7fffffffe55c)
64 at dbus-transport-socket.c:442
65 #9 0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0,
66 watch=0x6f4190, flags=1) at dbus-transport-socket.c:921
67 #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0,
68
69Once send_negotiate_unix_fd failed, this failure will happen, since
70auth->guid_from_server has been set to some value before
71send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to
72this auth be handled by process_ok again, but this auth->guid_from_server
73is not zero.
74
75So we should clear auth->guid_from_server if send_negotiate_unix_fd failed
76
77Signed-off-by: Roy Li <rongqing.li@windriver.com>
78---
79 dbus/dbus-auth.c | 9 +++++++--
80 1 file changed, 7 insertions(+), 2 deletions(-)
81
82diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
83index d2c37a7..37b45c6 100644
84--- a/dbus/dbus-auth.c
85+++ b/dbus/dbus-auth.c
86@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth,
87 _dbus_verbose ("Got GUID '%s' from the server\n",
88 _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
89
90- if (auth->unix_fd_possible)
91- return send_negotiate_unix_fd(auth);
92+ if (auth->unix_fd_possible) {
93+ if (!send_negotiate_unix_fd(auth)) {
94+ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
95+ return FALSE;
96+ }
97+ return TRUE;
98+ }
99
100 _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
101 return send_begin (auth);
102--
1031.7.10.4
104
diff --git a/meta/recipes-core/dbus/dbus/dbus-1.init b/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 0000000000..42c86297c3
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,123 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: dbus
4# Required-Start: $remote_fs $syslog
5# Required-Stop: $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 1
8# Short-Description: D-Bus systemwide message bus
9# Description: D-Bus is a simple interprocess messaging system, used
10# for sending messages between applications.
11### END INIT INFO
12#
13# -*- coding: utf-8 -*-
14# Debian init.d script for D-BUS
15# Copyright © 2003 Colin Walters <walters@debian.org>
16
17# set -e
18
19# Source function library.
20. /etc/init.d/functions
21
22DAEMON=@bindir@/dbus-daemon
23NAME=dbus
24DAEMONUSER=messagebus # must match /etc/dbus-1/system.conf
25PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
26UUIDDIR=/var/lib/dbus
27DESC="system message bus"
28EVENTDIR=/etc/dbus-1/event.d
29
30test -x $DAEMON || exit 0
31
32# Source defaults file; edit that file to configure this script.
33ENABLED=1
34PARAMS=""
35if [ -e /etc/default/dbus ]; then
36 . /etc/default/dbus
37fi
38
39test "$ENABLED" != "0" || exit 0
40
41start_it_up()
42{
43 mkdir -p "`dirname $PIDFILE`"
44 if [ -e $PIDFILE ]; then
45 PIDDIR=/proc/$(cat $PIDFILE)
46 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
47 echo "$DESC already started; not starting."
48 else
49 echo "Removing stale PID file $PIDFILE."
50 rm -f $PIDFILE
51 fi
52 fi
53
54 if [ ! -d $UUIDDIR ]; then
55 mkdir -p $UUIDDIR
56 chown $DAEMONUSER $UUIDDIR
57 chgrp $DAEMONUSER $UUIDDIR
58 fi
59
60 dbus-uuidgen --ensure
61
62 echo -n "Starting $DESC: "
63 start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
64 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
65 echo "$NAME."
66 if [ -d $EVENTDIR ]; then
67 run-parts --arg=start $EVENTDIR
68 fi
69}
70
71shut_it_down()
72{
73 if [ -d $EVENTDIR ]; then
74 # TODO: --reverse when busybox supports it
75 run-parts --arg=stop $EVENTDIR
76 fi
77 echo -n "Stopping $DESC: "
78 start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \
79 --user $DAEMONUSER
80 # We no longer include these arguments so that start-stop-daemon
81 # can do its job even given that we may have been upgraded.
82 # We rely on the pidfile being sanely managed
83 # --exec $DAEMON -- --system $PARAMS
84 echo "$NAME."
85 rm -f $PIDFILE
86}
87
88reload_it()
89{
90 echo -n "Reloading $DESC config: "
91 dbus-send --print-reply --system --type=method_call \
92 --dest=org.freedesktop.DBus \
93 / org.freedesktop.DBus.ReloadConfig > /dev/null
94 # hopefully this is enough time for dbus to reload it's config file.
95 echo "done."
96}
97
98case "$1" in
99 start)
100 start_it_up
101 ;;
102 stop)
103 shut_it_down
104 ;;
105 status)
106 status $DAEMON
107 exit $?
108 ;;
109 reload|force-reload)
110 reload_it
111 ;;
112 restart)
113 shut_it_down
114 sleep 1
115 start_it_up
116 ;;
117 *)
118 echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
119 exit 1
120 ;;
121esac
122
123exit 0
diff --git a/meta/recipes-core/dbus/dbus/os-test.patch b/meta/recipes-core/dbus/dbus/os-test.patch
new file mode 100644
index 0000000000..79554b1ee1
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/os-test.patch
@@ -0,0 +1,35 @@
1dbus: remove build host test in configure script
2
3The dbus build tests the build host to detect what initscript
4environment it expects. Remove the test and set it to "redhat"
5unconditionally as the oe-core initscript has a redhat-style pid file
6path.
7
8Signed-off-by: Andy Ross <andy.ross@windriver.com>
9Upstream-Status: innappropriate [embedded]
10
11diff -u a/configure.ac b/configure.ac
12--- a/configure.ac 2012-08-28 11:23:43.040609874 -0700
13+++ b/configure.ac 2012-08-28 11:54:25.602913945 -0700
14@@ -1348,19 +1348,8 @@
15 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
16 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
17
18-#### Check our operating system
19-operating_system=unknown
20-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
21- operating_system=redhat
22-fi
23-
24-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
25- operating_system=slackware
26-fi
27-
28-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
29- operating_system=cygwin
30-fi
31+#### Build host test removed from upstream code, openembedded initscript is redhat-like:
32+operating_system=redhat
33
34 #### Sort out init scripts
35
diff --git a/meta/recipes-core/dbus/dbus/python-config.patch b/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 0000000000..294400247e
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/python-config.patch
@@ -0,0 +1,25 @@
1When building the dbus-ptest package, we have to enable python. However
2checking if the host-system python has the necessary library isn't useful.
3
4Disable the python module check for cross compiling.
5
6Upstream-Status: Inappropriate [oe specific]
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10--- dbus-1.6.8/configure.ac.orig 2013-07-11 14:15:58.834554799 -0500
11+++ dbus-1.6.8/configure.ac 2013-07-11 14:14:40.969554848 -0500
12@@ -257,13 +257,6 @@
13 # full test coverage is required, Python is a hard dependency
14 AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
15 AM_PATH_PYTHON([2.6])
16- AC_MSG_CHECKING([for Python modules for full test coverage])
17- if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
18- AC_MSG_RESULT([yes])
19- else
20- AC_MSG_RESULT([no])
21- AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
22- fi
23 else
24 # --enable-tests not given: do not abort if Python is missing
25 AM_PATH_PYTHON([2.6], [], [:])
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 0000000000..c72d083a91
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3output() {
4 if [ $? -eq 0 ]
5 then echo "PASS: $i"
6 else echo "FAIL: $i"
7 fi
8}
9
10for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
diff --git a/meta/recipes-core/dbus/dbus/tmpdir.patch b/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 0000000000..bf086e1788
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,44 @@
1From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Thu, 23 Jun 2011 13:52:09 +0200
4Subject: [PATCH] buildsys: hardcode socketdir to /tmp
5
6the TMPDIR env var isn't always pointing to the right target path
7
8Upstream-Status: Inappropriate [embedded]
9
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11
12Original comment:
13
14 avoid to check tmp dir at build time. instead uses hard coded /tmp here
15 comment added by Kevin Tian <kevin.tian@intel.com>
16---
17 configure.ac | 11 +----------
18 1 files changed, 1 insertions(+), 10 deletions(-)
19
20diff --git a/configure.ac b/configure.ac
21index 408054b..6d26180 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
25 AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
26 [Full path to the launch helper test program in the builddir])
27
28-#### Find socket directories
29-if ! test -z "$TMPDIR" ; then
30- DEFAULT_SOCKET_DIR=$TMPDIR
31-elif ! test -z "$TEMP" ; then
32- DEFAULT_SOCKET_DIR=$TEMP
33-elif ! test -z "$TMP" ; then
34- DEFAULT_SOCKET_DIR=$TMP
35-else
36- DEFAULT_SOCKET_DIR=/tmp
37-fi
38+DEFAULT_SOCKET_DIR=/tmp
39
40 DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
41
42--
431.6.6.1
44