dbus/bus
hongjinghao b159849e03 bus: Assign a serial number for messages from the driver
Normally, it's enough to rely on a message being given a serial number
by the DBusConnection just before it is actually sent. However, in the
rare case where the policy blocks the driver from sending a message
(due to a deny rule or the outgoing message quota being full), we need
to get a valid serial number sooner, so that we can copy it into the
DBUS_HEADER_FIELD_REPLY_SERIAL field (which is mandatory) in the error
message sent to monitors. Otherwise, the dbus-daemon will crash with
an assertion failure if at least one Monitoring client is attached,
because zero is not a valid serial number to copy.

This fixes a denial-of-service vulnerability: if a privileged user is
monitoring the well-known system bus using a Monitoring client like
dbus-monitor or `busctl monitor`, then an unprivileged user can cause
denial-of-service by triggering this crash. A mitigation for this
vulnerability is to avoid attaching Monitoring clients to the system
bus when they are not needed. If there are no Monitoring clients, then
the vulnerable code is not reached.

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus/dbus#457
2023-06-06 12:01:02 +01:00
..
legacy-config build: Add machine-readable licensing markers to the Meson build system 2022-07-13 20:36:13 +01:00
systemd-user build: Add machine-readable licensing markers to the Meson build system 2022-07-13 20:36:13 +01:00
sysusers.d build: Add machine-readable licensing markers to the Meson build system 2022-07-13 20:36:13 +01:00
tmpfiles.d build: Add machine-readable licensing markers to the Meson build system 2022-07-13 20:36:13 +01:00
.gitignore .gitignore: Ignore many more generated files 2018-12-14 13:28:50 +00:00
activation-exit-codes.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
activation-helper-bin.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
activation-helper.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
activation-helper.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
activation.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
activation.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
apparmor.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
apparmor.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
audit.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
audit.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
bus.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
bus.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
CMakeLists.txt Use project relative paths in CMake files 2022-07-25 14:14:57 -05:00
config-loader-expat.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser-common.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser-common.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser-trivial.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser-trivial.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
config-parser.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
connection.c bus: Assign a serial number for messages from the driver 2023-06-06 12:01:02 +01:00
connection.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
containers.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
containers.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dbus.service.in bus: Notify systemd when we are ready 2018-03-02 14:48:49 +00:00
dbus.socket.in systemd: enable the dbus service unconditionally 2010-09-06 03:21:17 +02:00
desktop-file.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
desktop-file.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dir-watch-default.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dir-watch-inotify.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dir-watch-kqueue.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dir-watch.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dispatch.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
dispatch.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
driver.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
driver.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
example-session-disable-stats.conf.in config: add examples to show how to enable/disable the Stats interface 2014-10-01 16:38:40 +01:00
example-system-enable-stats.conf.in config: add examples to show how to enable/disable the Stats interface 2014-10-01 16:38:40 +01:00
example-system-hardening-without-traditional-activation.conf Configure option to disable traditional activation 2019-03-25 21:51:33 +02:00
expirelist.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
expirelist.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
main.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
Makefile.am build: Put system bus socket in runstatedir by default 2022-10-11 17:14:11 +01:00
meson.build build: Put system bus socket in runstatedir by default 2022-10-11 17:14:11 +01:00
org.freedesktop.dbus-session.plist.in 10.4 is old so set more sensible launchd defaults. 2010-12-09 08:20:07 +01:00
policy.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
policy.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
selinux.c bus/selinux: Move vsnprintf call to avoid va_list reuse 2023-01-09 20:03:29 +00:00
selinux.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
services.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
services.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
session.conf.in Disable the Containers interface 2021-12-10 16:48:51 +00:00
signals.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
signals.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
stats.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
stats.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
system.conf.in Disable the Containers interface 2021-12-10 16:48:51 +00:00
test.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
test.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
utils.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
utils.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00