- 15 Apr, 2015 1 commit
-
-
Ralf Habacker authored
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit fa1ada44) Conflicts: cmake/test/CMakeLists.txt test/Makefile.am
-
- 13 Apr, 2015 2 commits
-
-
Ralf Habacker authored
The watches added on connection setup should be removed on shutdown. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90005Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Ralf Habacker authored
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90004Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- 09 Feb, 2015 1 commit
-
-
Ralf Habacker authored
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit 795ea300)
-
- 05 Feb, 2015 1 commit
-
-
Simon McVittie authored
-
- 04 Feb, 2015 3 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
Without either this rule or better checking in dbus-daemon, non-systemd processes can make dbus-daemon think systemd failed to activate a system service, resulting in an error reply back to the requester. This is redundant with the fix in the C code (which I consider to be the real solution), but is likely to be easier to backport. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88811 Reviewed-by: Alban Crequy Reviewed-by: David King Reviewed-by: Philip Withnall
-
Simon McVittie authored
-
- 05 Jan, 2015 4 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
dbus-1.8.14
-
Ralf Habacker authored
We need to include 'test' subdir in any case not only when using glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88009Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Ralf Habacker authored
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71297Reviewed-by:
Ralf Habacker <ralf.habacker@freenet.de>
-
- 01 Jan, 2015 5 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
These function calls are not a privilege escalation risk like UpdateActivationEnvironment, but they might provide sensitive information or be enhanced to provide sensitive information in future, so the default system.conf locks them down to root-only. Apply the same canonical-object-path hardening as for UpdateActivationEnvironment. We do not apply the uid check here because they are less dangerous than UpdateActivationEnvironment, and because the ability to unlock these function calls for specific uids is a documented configuration for developers. Reviewed-by:
Thiago Macieira <thiago@kde.org> [added missing #include; extended commit message -smcv]
-
Simon McVittie authored
Reviewed-by:
Thiago Macieira <thiago@kde.org>
-
Simon McVittie authored
As with the previous commit, this is probably not actually privilege escalation due to the use of an activation helper that cleans up its environment, but let's be extra-careful here. Reviewed-by:
Thiago Macieira <thiago@kde.org> [adjusted commit message -smcv]
-
Simon McVittie authored
UpdateActivationEnvironment is the one dbus-daemon API call that is obviously dangerous (it is intended for the session bus), so the default system.conf does not allow anyone to call it. It has recently come to the D-Bus maintainers' attention that some system services incorrectly install D-Bus policy rules that allow arbitrary method calls to any destination as long as they have a "safe" object path. This is not actually safe: some system services that use low-level D-Bus bindings like libdbus, including dbus-daemon itself, provide the same API on all object paths. Unauthorized calls to UpdateActivationEnvironment are probably just resource consumption rather than privilege escalation, because on the system bus, the modified environment is only used to execute a setuid wrapper that avoids LD_PRELOAD etc. via normal setuid handling, and sanitizes its own environment before executing the real service. However, it's safest to assume the worst and treat it as a potential privilege escalation. Accordingly, as a hardening measure to avoid privilege escalation on systems with these faulty services, stop allowing calls to ("/com/example/Whatever", "org.freedesktop.DBus.UpdateActivationEnvironment") and only allow ("/org/freedesktop/DBus", "org.freedesktop.DBus.UpdateActivationEnvironment"). We deliberately continue to provide read-only APIs like GetConnectionUnixUser at all object paths, for backwards compatibility. Reviewed-by:
Thiago Macieira <thiago@kde.org> [adjusted commit message to note that this is probably only DoS -smcv]
-
- 23 Dec, 2014 1 commit
-
-
Илья А. Ткаченко authored
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77008Reviewed-by:
Ralf Habacker <ralf.habacker@freenet.de>
-
- 24 Nov, 2014 2 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
-
- 22 Nov, 2014 2 commits
-
-
Simon McVittie authored
This reverts commit 54d26df5. It appears this change may cause intermittent slow or failed boot, more commonly on slower/older machines, in at least Mageia and possibly also Debian. This would indicate that while the system is under load, system services are not completing authentication within 5 seconds. This change was not the main part of fixing CVE-2014-3639, but does help to mitigate that attack. As such, increasing this timeout makes the denial of service attack described by CVE-2014-3639 somewhat more effective: a local user connecting to the system bus repeatedly from many parallel processes can cause other users' attempts to connect to take longer. If your machine boots reliably with the shorter timeout, and resilience against local denial of service attacks is important to you, putting this in /etc/dbus-1/system-local.conf or a file matching /etc/dbus-1/system.d/*.conf can restore the lower limit: <busconfig> <limit name="auth_timeout">5000</limit> </busconfig> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86431
-
Simon McVittie authored
This is a symptom of either a denial of service attack, or a serious performance problem. Either way, sysadmins should know. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86431
-
- 14 Nov, 2014 3 commits
-
-
Simon McVittie authored
We now have a private mailing list that can be the security contact.
-
Simon McVittie authored
-
Jacek Bukarewicz authored
This makes bus_context_check_security_policy follow convention of setting errors if function indicates failure and has error parameter. Notable implication is that AccessDenied error will be sent if sending message to addressed recipient is denied due to receive rule. Previously, message was silently dropped. This also fixes assertion failure when message is denied at addressed recipient while sending pending auto activation messages. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86194
-
- 10 Nov, 2014 2 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
-
- 06 Nov, 2014 2 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
This ensures that our rlimit is actually high enough to avoid the denial of service described in CVE-2014-3636 part A. CVE-2014-7824 has been allocated for this incomplete fix. Restore the original rlimit for activated services, to avoid them getting undesired higher limits. (Thanks to Alban Crequy for various adjustments which have been included in this commit.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85105Reviewed-by:
Alban Crequy <alban.crequy@collabora.co.uk>
-
- 16 Sep, 2014 1 commit
-
-
Simon McVittie authored
-
- 15 Sep, 2014 10 commits
-
-
Simon McVittie authored
-
Simon McVittie authored
This addresses CVE-2014-3635. If (*n_fds * sizeof (int) % sizeof (size_t)) is nonzero, then CMSG_SPACE (*n_fds * sizeof (int)) > CMSG_LEN (*n_fds * sizeof (int) because the SPACE includes padding to a size_t boundary, whereas the LEN does not. We have to allocate the SPACE. Previously, we told the kernel that the buffer size we wanted was the SPACE, not the LEN, which meant it was free to fill the padding with additional fds: on a 64-bit platform with 32-bit int, that's one extra fd, if *n_fds happens to be odd. This meant that a malicious sender could send exactly 1 fd too many, which would make us fail an assertion if enabled, or overrun a buffer by 1 fd otherwise. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83622Reviewed-by:
Alban Crequy <alban.crequy@collabora.co.uk>
-
Simon McVittie authored
This means we can use _DBUS_STATIC_ASSERT at non-global scope without tripping -Wunused-local-typedefs. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83767Reviewed-by:
Alban Crequy <alban.crequy@collabora.co.uk> (cherry picked from commit 0e3d08d4)
-
Alban Crequy authored
This is one of four commits needed to address CVE-2014-3637. The bus uses _dbus_connection_set_pending_fds_function and _dbus_connection_get_pending_fds_count to be notified when there are pending file descriptors. A timeout per connection is armed and disarmed when the file descriptor list is used and emptied. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Alban Crequy authored
This is one of four commits needed to address CVE-2014-3637. This will allow the bus to be notified whenever a file descriptor is added or removed from a DBusConnection's DBusMessageLoader. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Alban Crequy authored
This is one of four commits needed to address CVE-2014-3637. This will allow the bus to know whether there are pending file descriptors in a DBusConnection's DBusMessageLoader. https://bugs.freedesktop.org/show_bug.cgi?id=80559Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk> [fix compilation on platforms that do not HAVE_UNIX_FD_PASSING -smcv] Signed-off-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Alban Crequy authored
This is one of four commits needed to address CVE-2014-3637. When a file descriptor is passed to dbus-daemon, the associated D-Bus message might not be fully sent to dbus-daemon yet. Dbus-daemon keeps the file descriptor in the DBusMessageLoader of the connection, waiting for the rest of the message. If the client stops sending the remaining bytes, dbus-daemon will wait forever and keep that file descriptor. This patch adds pending_fd_timeout (milliseconds) in the configuration to disconnect a connection after a timeout when a file descriptor was sent but not the remaining message. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Alban Crequy authored
This addresses the parts of CVE-2014-3639 not already addressed by reducing the default authentication timeout. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80851 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80919Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Alban Crequy authored
This partially addresses CVE-2014-3639. This will change the default on the system bus where the limit <limit name="auth_timeout">...</limit> is not specified. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80919Reviewed-by:
Thiago Macieira <thiago@kde.org> Reviewed-by:
Simon McVittie <simon.mcvittie@collabora.co.uk>
-
Simon McVittie authored
This addresses CVE-2014-3636. Based on a patch by Alban Crequy. Now that it's the same on all platforms, there's little point in it being set by configure/cmake. This change fixes two distinct denials of service: fd.o#82820, part A ------------------ Before this patch, the system bus had the following default configuration: - max_connections_per_user: 256 - DBUS_DEFAULT_MESSAGE_UNIX_FDS: usually 1024 (or 256 on QNX, see fd.o#61176) as defined by configure.ac - max_incoming_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS*4 = usually 4096 - max_outgoing_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS*4 = usually 4096 - max_message_unix_fds: DBUS_DEFAULT_MESSAGE_UNIX_FDS = usually 1024 This means that a single user could create 256 connections and transmit 256*4096 = 1048576 file descriptors. The file descriptors stay attached to the dbus-daemon process while they are in the message loader, in the outgoing queue or waiting to be dispatched before D-Bus activation. dbus-daemon is usually limited to 65536 file descriptors (ulimit -n). If the limit is reached and dbus-daemon needs to receive a message with a file descriptor attached, this is signalled by recvfrom with the flag MSG_CTRUNC. Dbus-daemon cannot recover from that error because the kernel does not have any API to retrieve a file descriptor which has been discarded with MSG_CTRUNC. Therefore, it closes the connection of the sender. This is not necessarily the connection which generated the most file descriptors so it can lead to denial-of-service attacks. In order to prevent DoS issues, this patch reduces DEFAULT_MESSAGE_UNIX_FDS to 16: max_connections_per_user * max_incoming_unix_fds = 256 * 64 = 16384 This is less than the usual "ulimit -n" (65536) with a good margin to accomodate the other sources of file descriptors (stdin/stdout/stderr, listening sockets, message loader, etc.). Distributors on non-Linux may need to configure a smaller limit in system.conf, if their limit on the number of fds is smaller than Linux's. fd.o#82820, part B ------------------ On Linux, it's not possible to send more than 253 fds in a single sendmsg() call: sendmsg() would return -EINVAL. #define SCM_MAX_FD 253 SCM_MAX_FD changed value during Linux history: - it used to be (OPEN_MAX-1) - commit c09edd6eb (Jul 2007) changed it to 255 - commit bba14de98 (Nov 2010) changed it to 253 Libdbus always sends all of a message's fds, and the beginning of the message itself, in a single sendmsg() call. Combining these two, a malicious sender could split a message across two or more sendmsg() calls to construct a composite message with 254 or more fds. When dbus-daemon attempted to relay that message to its recipient in a single sendmsg() call, it would receive EINVAL, interpret that as a fatal socket error and disconnect the recipient, resulting in denial of service. This is fixed by keeping max_message_unix_fds <= SCM_MAX_FD. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82820Reviewed-by:
Alban Crequy <alban.crequy@collabora.co.uk>
-