public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mingw-dbus] f44: Backport fix for CVE-2026-120749
@ 2026-11-13 14:51 Sandro Mani
0 siblings, 0 replies; only message in thread
From: Sandro Mani @ 2026-11-13 14:51 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/mingw-dbus
Branch : f44
Commit : 7aa448133294e93d8805f028fb6dbd392f7aebb8
Author : Sandro Mani <manisandro@gmail.com>
Date : 2026-11-13T15:50:33+01:00
Stats : +340/-3 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/mingw-dbus/c/7aa448133294e93d8805f028fb6dbd392f7aebb8?branch=f44
Log:
Backport fix for CVE-2026-120749
---
diff --git a/d1f69343c67077b85c6cf5c91f1c3b15389760c1.patch b/d1f69343c67077b85c6cf5c91f1c3b15389760c1.patch
new file mode 100644
index 0000000..a9e001f
--- /dev/null
+++ b/d1f69343c67077b85c6cf5c91f1c3b15389760c1.patch
@@ -0,0 +1,332 @@
+diff -rupN --no-dereference dbus-1.16.2/bus/activation.c dbus-1.16.2-new/bus/activation.c
+--- dbus-1.16.2/bus/activation.c 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/bus/activation.c 2026-11-13 15:50:08.055205945 +0100
+@@ -2144,6 +2144,11 @@ bus_activation_activate_service (BusActi
+ if (service)
+ systemd = bus_service_get_primary_owners_connection (service);
+
++ /* If we already have a DBusConnection for systemd, we allocate
++ * a serial number as if for a method call, or if not, we
++ * allocate a serial number as if for a broadcast. */
++ bus_message_from_driver_ensure_serial (message, systemd);
++
+ /* Following the general principle of "log early and often",
+ * we capture that we *want* to send the activation message, even if
+ * systemd is not actually there to receive it yet */
+diff -rupN --no-dereference dbus-1.16.2/bus/bus.c dbus-1.16.2-new/bus/bus.c
+--- dbus-1.16.2/bus/bus.c 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/bus/bus.c 2026-11-13 15:50:08.055507431 +0100
+@@ -1108,6 +1108,8 @@ bus_context_send_activatable_services_ch
+ goto out;
+ }
+
++ bus_message_from_driver_ensure_serial (message, NULL);
++
+ if (!bus_transaction_capture (transaction, NULL, NULL, message))
+ {
+ BUS_SET_OOM (error);
+diff -rupN --no-dereference dbus-1.16.2/bus/connection.c dbus-1.16.2-new/bus/connection.c
+--- dbus-1.16.2/bus/connection.c 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/bus/connection.c 2026-11-13 15:50:08.057121660 +0100
+@@ -131,6 +131,42 @@ static void bus_connection_drop_pending_
+
+ static dbus_bool_t expire_incomplete_timeout (void *data);
+
++/* This has the same logic as _dbus_connection_get_next_client_serial(),
++ * but instead of one serial number per connection, the message bus
++ * maintains one global serial number to be used on broadcasts. */
++static dbus_uint32_t
++get_next_broadcast_serial (void)
++{
++ /* Start just before the wrap-around, so that the wrap-around is tested */
++ static dbus_uint32_t next_broadcast_serial = 0xFFFFFFFFu;
++ dbus_uint32_t ret;
++
++ ret = next_broadcast_serial++;
++
++ if (next_broadcast_serial == 0)
++ next_broadcast_serial = 1;
++
++ return ret;
++}
++
++void
++bus_message_from_driver_ensure_serial (DBusMessage *message,
++ DBusConnection *addressed_recipient)
++{
++ if (dbus_message_get_serial (message) == 0)
++ {
++ dbus_uint32_t serial;
++
++ if (addressed_recipient != NULL)
++ serial = _dbus_connection_get_next_client_serial (addressed_recipient);
++ else
++ serial = get_next_broadcast_serial ();
++
++ _dbus_assert (serial != 0);
++ dbus_message_set_serial (message, serial);
++ }
++}
++
+ #define BUS_CONNECTION_DATA(connection) (dbus_connection_get_data ((connection), connection_data_slot))
+
+ static DBusLoop*
+@@ -2249,6 +2285,14 @@ bus_transaction_get_context (BusTransact
+ /**
+ * Reserve enough memory to capture the given message if the
+ * transaction goes through.
++ *
++ * The message must already have a serial number and a sender.
++ * For messages received from a client, the client was responsible for
++ * assigning a serial number and bus_dispatch() was responsible for
++ * assigning the sender.
++ * For messages generated internally by the dbus-daemon, the source of
++ * the message is responsible for setting the sender to DBUS_SERVICE_DBUS
++ * and assigning a serial number.
+ */
+ dbus_bool_t
+ bus_transaction_capture (BusTransaction *transaction,
+@@ -2262,6 +2306,9 @@ bus_transaction_capture (BusTransaction
+ DBusList *recipients = NULL;
+ dbus_bool_t ret = FALSE;
+
++ _dbus_assert (dbus_message_get_serial (message) != 0);
++ _dbus_assert (dbus_message_get_sender (message) != NULL);
++
+ connections = bus_context_get_connections (transaction->context);
+
+ /* shortcut: don't compose the message unless someone wants it */
+@@ -2323,6 +2370,7 @@ bus_transaction_capture_error_reply (Bus
+ if (!dbus_message_set_sender (reply, DBUS_SERVICE_DBUS))
+ goto out;
+
++ bus_message_from_driver_ensure_serial (reply, addressed_recipient);
+ ret = bus_transaction_capture (transaction, NULL, addressed_recipient, reply);
+
+ out:
+@@ -2359,13 +2407,7 @@ bus_transaction_send_from_driver (BusTra
+ * connection, when the transaction is committed, but that's too late
+ * in this case.
+ */
+- if (dbus_message_get_serial (message) == 0)
+- {
+- dbus_uint32_t next_serial;
+-
+- next_serial = _dbus_connection_get_next_client_serial (connection);
+- dbus_message_set_serial (message, next_serial);
+- }
++ bus_message_from_driver_ensure_serial (message, connection);
+
+ if (bus_connection_is_active (connection))
+ {
+diff -rupN --no-dereference dbus-1.16.2/bus/connection.h dbus-1.16.2-new/bus/connection.h
+--- dbus-1.16.2/bus/connection.h 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/bus/connection.h 2026-11-13 15:50:08.054961561 +0100
+@@ -175,4 +175,7 @@ int bus_connections_get_peak_bus_names_p
+ int bus_connection_get_peak_match_rules (DBusConnection *connection);
+ int bus_connection_get_peak_bus_names (DBusConnection *connection);
+
++void bus_message_from_driver_ensure_serial (DBusMessage *message,
++ DBusConnection *addressed_recipient);
++
+ #endif /* BUS_CONNECTION_H */
+diff -rupN --no-dereference dbus-1.16.2/bus/driver.c dbus-1.16.2-new/bus/driver.c
+--- dbus-1.16.2/bus/driver.c 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/bus/driver.c 2026-11-13 15:50:08.057536139 +0100
+@@ -267,6 +267,8 @@ bus_driver_send_service_owner_changed (c
+
+ _dbus_assert (dbus_message_has_signature (message, "sss"));
+
++ bus_message_from_driver_ensure_serial (message, NULL);
++
+ if (!bus_transaction_capture (transaction, NULL, NULL, message))
+ goto oom;
+
+@@ -1007,7 +1009,8 @@ bus_driver_send_ack_reply (DBusConnectio
+
+ /*
+ * Send a message from the driver, activating the destination if necessary.
+- * The message must already have a destination set.
++ * The message must already have sender and destination set,
++ * but a serial number will be added if necessary.
+ */
+ static dbus_bool_t
+ bus_driver_send_or_activate (BusTransaction *transaction,
+@@ -1019,11 +1022,14 @@ bus_driver_send_or_activate (BusTransact
+ const char *service_name;
+ DBusString service_string;
+
++ _dbus_assert (transaction != NULL);
++ _dbus_assert (message != NULL);
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ service_name = dbus_message_get_destination (message);
+
+ _dbus_assert (service_name != NULL);
++ _dbus_assert (dbus_message_get_sender (message) != NULL);
+
+ _dbus_string_init_const (&service_string, service_name);
+
+@@ -1039,6 +1045,11 @@ bus_driver_send_or_activate (BusTransact
+
+ activation = bus_context_get_activation (context);
+
++ /* Assign a serial number as though this was a broadcast,
++ * since we don't yet know who will receive it.
++ * In practice replies are ignored anyway. */
++ bus_message_from_driver_ensure_serial (message, NULL);
++
+ if (!bus_transaction_capture (transaction, NULL, NULL, message))
+ {
+ BUS_SET_OOM (error);
+@@ -1060,6 +1071,8 @@ bus_driver_send_or_activate (BusTransact
+
+ service_conn = bus_service_get_primary_owners_connection (service);
+
++ bus_message_from_driver_ensure_serial (message, service_conn);
++
+ if (!bus_transaction_send_from_driver (transaction, service_conn, message))
+ {
+ BUS_SET_OOM (error);
+diff -rupN --no-dereference dbus-1.16.2/NEWS dbus-1.16.2-new/NEWS
+--- dbus-1.16.2/NEWS 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/NEWS 2026-11-13 15:50:08.058335869 +0100
+@@ -7,6 +7,18 @@ Build system:
+ Please see CONTRIBUTING.md for details of how to update existing checkouts.
+ (dbus#530, Simon McVittie)
+
++Denial-of-service fixes:
++
++• Prevent a denial-of-service vulnerability on the system bus:
++ if a privileged user was running a monitor such as `dbus-monitor --system`
++ or `busctl monitor --system`, then an unprivileged user could cause the
++ dbus-daemon to crash by arranging for delivery of a broadcast signal
++ from the dbus-daemon to be prevented, for example by filling up the
++ outgoing message queue towards a client that subscribed to it.
++ This vulnerability could be seen as an incomplete fix for CVE-2023-34969.
++ Thanks to parkma99.
++ (dbus#576, CVE-2026-120749; Simon McVittie, David King)
++
+ Bug fixes:
+
+ • On Linux, fix build regression with libselinux ≥ 3.8 and verbose mode
+diff -rupN --no-dereference dbus-1.16.2/test/data/valid-config-files/forbidding.conf.in dbus-1.16.2-new/test/data/valid-config-files/forbidding.conf.in
+--- dbus-1.16.2/test/data/valid-config-files/forbidding.conf.in 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/test/data/valid-config-files/forbidding.conf.in 2026-11-13 15:50:08.057838626 +0100
+@@ -27,5 +27,8 @@
+
+ <!-- Used to reproduce dbus#457 -->
+ <deny receive_interface="org.freedesktop.DBus" receive_member="NameAcquired"/>
++
++ <!-- Used to reproduce dbus#576 -->
++ <deny receive_interface="org.freedesktop.DBus" receive_member="NameOwnerChanged"/>
+ </policy>
+ </busconfig>
+diff -rupN --no-dereference dbus-1.16.2/test/monitor.c dbus-1.16.2-new/test/monitor.c
+--- dbus-1.16.2/test/monitor.c 2025-02-27 17:29:06.000000000 +0100
++++ dbus-1.16.2-new/test/monitor.c 2026-11-13 15:50:08.058019567 +0100
+@@ -1100,6 +1100,94 @@ test_forbidden_broadcast (Fixture *f,
+ g_assert (m == NULL);
+ }
+
++/*
++ * Regression test for https://gitlab.freedesktop.org/dbus/dbus/-/issues/576:
++ * when a bus-generated broadcast such as NameOwnerChanged cannot be delivered
++ * to a subscriber (due to a <deny> rule or exceeding max_outgoing_bytes),
++ * with a monitor attached, the daemon synthesizes an error reply for
++ * monitors. Before the fix, the NameOwnerChanged message had no serial
++ * number, causing the daemon to crash (assertion failure / SIGABRT) when
++ * creating the error reply.
++ *
++ * This is analogous to the initial PoC, but uses a <deny> rule instead of
++ * filling the outgoing queue, to achieve the same undeliverable-broadcast
++ * condition deterministically.
++ */
++static void
++test_forbidden_name_owner_changed (Fixture *f,
++ gconstpointer context)
++{
++ DBusConnection *extra;
++ DBusMessage *m;
++ DBusMessage *noc;
++
++ if (f->address == NULL)
++ return;
++
++ /* The recipient subscribes to NameOwnerChanged. The forbidding config
++ * denies receiving it, so delivery will fail. With a monitor attached,
++ * the daemon must synthesize an error reply for the monitor. */
++ dbus_bus_add_match (f->recipient,
++ "type='signal',interface='org.freedesktop.DBus',"
++ "member='NameOwnerChanged'",
++ &f->e);
++ test_assert_no_error (&f->e);
++
++ become_monitor (f, NULL);
++
++ /* Creating a new connection triggers a NameOwnerChanged broadcast
++ * from the bus driver. Before the fix for dbus#576, this would crash
++ * the daemon because NameOwnerChanged had no serial number when the
++ * daemon tried to create an error reply for the monitor. */
++ extra = test_connect_to_bus (f->ctx, f->address);
++
++ /* Expected monitored messages:
++ * 1. Hello method call
++ * 2. Hello reply
++ * 3. NameOwnerChanged signal (bus-generated broadcast)
++ * 4. AccessDenied error (for denied NameOwnerChanged delivery)
++ * 5. NameAcquired signal (bus-generated unicast to extra)
++ * 6. AccessDenied error (for denied NameAcquired delivery)
++ */
++ while (g_queue_get_length (&f->monitored) < 6)
++ test_main_context_iterate (f->ctx, TRUE);
++
++ m = g_queue_pop_head (&f->monitored);
++ assert_hello (m);
++ dbus_message_unref (m);
++
++ m = g_queue_pop_head (&f->monitored);
++ assert_hello_reply (m);
++ dbus_message_unref (m);
++
++ noc = g_queue_pop_head (&f->monitored);
++ assert_signal (noc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS,
++ "NameOwnerChanged", "sss", NULL);
++
++ /* The error reply for the denied NameOwnerChanged delivery.
++ * Before dbus#576 was fixed, the daemon would have crashed before
++ * reaching this point. */
++ m = g_queue_pop_head (&f->monitored);
++ assert_error_reply (m, DBUS_SERVICE_DBUS, DBUS_SERVICE_DBUS,
++ DBUS_ERROR_ACCESS_DENIED);
++ g_assert_cmpint (dbus_message_get_reply_serial (m), ==,
++ dbus_message_get_serial (noc));
++ dbus_message_unref (m);
++ dbus_message_unref (noc);
++
++ m = g_queue_pop_head (&f->monitored);
++ assert_unique_name_acquired (m);
++ expect_name_acquired_error (&f->monitored, m);
++ dbus_message_unref (m);
++
++ m = g_queue_pop_head (&f->monitored);
++ g_assert (m == NULL);
++
++ test_connection_shutdown (f->ctx, extra);
++ dbus_connection_close (extra);
++ dbus_connection_unref (extra);
++}
++
+ static void
+ test_unicast_signal (Fixture *f,
+ gconstpointer context)
+@@ -2038,6 +2126,9 @@ main (int argc,
+ setup, test_broadcast, teardown);
+ g_test_add ("/monitor/forbidden-broadcast", Fixture, &forbidding_config,
+ setup, test_forbidden_broadcast, teardown);
++ g_test_add ("/monitor/forbidden-name-owner-changed",
++ Fixture, &forbidding_config,
++ setup, test_forbidden_name_owner_changed, teardown);
+ g_test_add ("/monitor/unicast-signal", Fixture, NULL,
+ setup, test_unicast_signal, teardown);
+ g_test_add ("/monitor/forbidden", Fixture, &forbidding_config,
diff --git a/dbus-static-libs.patch b/dbus-static-libs.patch
index 76d4466..ec48952 100644
--- a/dbus-static-libs.patch
+++ b/dbus-static-libs.patch
@@ -1,6 +1,6 @@
diff -rupN --no-dereference dbus-1.16.2/CMakeLists.txt dbus-1.16.2-new/CMakeLists.txt
--- dbus-1.16.2/CMakeLists.txt 2025-02-27 17:29:06.000000000 +0100
-+++ dbus-1.16.2-new/CMakeLists.txt 2025-12-27 19:59:37.843098370 +0100
++++ dbus-1.16.2-new/CMakeLists.txt 2026-11-13 15:50:08.010073587 +0100
@@ -100,7 +100,8 @@ set(DBUS_LIBEXECDIR ${CMAKE_INS
set(DBUS_DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
@@ -13,7 +13,7 @@ diff -rupN --no-dereference dbus-1.16.2/CMakeLists.txt dbus-1.16.2-new/CMakeList
diff -rupN --no-dereference dbus-1.16.2/dbus/CMakeLists.txt dbus-1.16.2-new/dbus/CMakeLists.txt
--- dbus-1.16.2/dbus/CMakeLists.txt 2025-02-27 17:29:06.000000000 +0100
-+++ dbus-1.16.2-new/dbus/CMakeLists.txt 2025-12-27 19:59:37.843568166 +0100
++++ dbus-1.16.2-new/dbus/CMakeLists.txt 2026-11-13 15:50:08.010396398 +0100
@@ -263,13 +263,20 @@ find_library(LIBRT rt)
find_library(LIBSOCKET socket)
diff --git a/mingw-dbus.spec b/mingw-dbus.spec
index d10f298..59bc4a0 100644
--- a/mingw-dbus.spec
+++ b/mingw-dbus.spec
@@ -2,7 +2,7 @@
Name: mingw-dbus
Version: 1.16.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: MinGW Windows port of D-Bus
# The effective license of the majority of the package, including the shared
@@ -13,6 +13,8 @@ Source0: http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.xz
# Restore support for static libs
Patch0: dbus-static-libs.patch
+# Backport fix for CVE-2026-120749
+Patch1: https://gitlab.freedesktop.org/dbus/dbus/-/commit/d1f69343c67077b85c6cf5c91f1c3b15389760c1.patch
BuildArch: noarch
@@ -156,6 +158,9 @@ rm -rf %{buildroot}%{mingw64_datadir}/xml
%changelog
+* Fri Nov 13 2026 Sandro Mani <manisandro@gmail.com> - 1.16.2-4
+- Backport fix for CVE-2026-120749
+
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-13 14:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 14:51 [rpms/mingw-dbus] f44: Backport fix for CVE-2026-120749 Sandro Mani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox