Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 936441 Details for
Bug 1140527
CVE-2014-3637 dbus: denial of service by creating unkillable D-Bus connections
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
initial upstream patch 3
0007-DBusConnection-implements-_dbus_connection_set_pendi.patch (text/plain), 8.21 KB, created by
Murray McAllister
on 2014-09-11 08:39:26 UTC
(
hide
)
Description:
initial upstream patch 3
Filename:
MIME Type:
Creator:
Murray McAllister
Created:
2014-09-11 08:39:26 UTC
Size:
8.21 KB
patch
obsolete
>From 14fdb2c2076ebb31ddd8cbba167a0f7d17ab59d8 Mon Sep 17 00:00:00 2001 >From: Alban Crequy <alban.crequy@collabora.co.uk> >Date: Fri, 18 Jul 2014 17:28:32 +0100 >Subject: [PATCH 07/11] DBusConnection: implements > _dbus_connection_set_pending_fds_function > >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=80559 >Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> >--- > dbus/dbus-connection-internal.h | 5 +++++ > dbus/dbus-connection.c | 16 ++++++++++++++++ > dbus/dbus-message-internal.h | 3 +++ > dbus/dbus-message-private.h | 2 ++ > dbus/dbus-message.c | 25 +++++++++++++++++++++++++ > dbus/dbus-transport.c | 16 ++++++++++++++++ > dbus/dbus-transport.h | 3 +++ > 7 files changed, 70 insertions(+) > >diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h >index 24e4772..2897404 100644 >--- a/dbus/dbus-connection-internal.h >+++ b/dbus/dbus-connection-internal.h >@@ -44,6 +44,8 @@ typedef enum > /** default timeout value when waiting for a message reply, 25 seconds */ > #define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000) > >+typedef void (* DBusPendingFdsChangeFunction) (void *data); >+ > void _dbus_connection_lock (DBusConnection *connection); > void _dbus_connection_unlock (DBusConnection *connection); > DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection); >@@ -101,6 +103,9 @@ void _dbus_connection_test_get_locks (DBusConnectio > DBusCondVar **dispatch_cond_loc, > DBusCondVar **io_path_cond_loc); > int _dbus_connection_get_pending_fds_count (DBusConnection *connection); >+void _dbus_connection_set_pending_fds_function (DBusConnection *connection, >+ DBusPendingFdsChangeFunction callback, >+ void *data); > > /* if DBUS_ENABLE_STATS */ > void _dbus_connection_get_stats (DBusConnection *connection, >diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c >index 6aa24bc..b574207 100644 >--- a/dbus/dbus-connection.c >+++ b/dbus/dbus-connection.c >@@ -2560,6 +2560,22 @@ _dbus_connection_get_pending_fds_count (DBusConnection *connection) > return _dbus_transport_get_pending_fds_count (connection->transport); > } > >+/** >+ * Register a function to be called whenever the number of pending file >+ * descriptors in the loader change. >+ * >+ * @param connection the connection >+ * @param callback the callback >+ */ >+void >+_dbus_connection_set_pending_fds_function (DBusConnection *connection, >+ DBusPendingFdsChangeFunction callback, >+ void *data) >+{ >+ _dbus_transport_set_pending_fds_function (connection->transport, >+ callback, data); >+} >+ > /** @} */ > > /** >diff --git a/dbus/dbus-message-internal.h b/dbus/dbus-message-internal.h >index 45cb026..e9a9ec0 100644 >--- a/dbus/dbus-message-internal.h >+++ b/dbus/dbus-message-internal.h >@@ -97,6 +97,9 @@ void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoad > long n); > long _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader *loader); > int _dbus_message_loader_get_pending_fds_count (DBusMessageLoader *loader); >+void _dbus_message_loader_set_pending_fds_function (DBusMessageLoader *loader, >+ void (* callback) (void *), >+ void *data); > > typedef struct DBusInitialFDs DBusInitialFDs; > DBusInitialFDs *_dbus_check_fdleaks_enter (void); >diff --git a/dbus/dbus-message-private.h b/dbus/dbus-message-private.h >index e1578ab..a611b09 100644 >--- a/dbus/dbus-message-private.h >+++ b/dbus/dbus-message-private.h >@@ -80,6 +80,8 @@ struct DBusMessageLoader > int *unix_fds; /**< File descriptors that have been read from the transport but not yet been handed to any message. Array will be allocated at first use. */ > unsigned n_unix_fds_allocated; /**< Number of file descriptors this array has space for */ > unsigned n_unix_fds; /**< Number of valid file descriptors in array */ >+ void (* unix_fds_change) (void *); /**< Notify when the pending fds change */ >+ void *unix_fds_change_data; > #endif > }; > >diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c >index 03c6be9..c34aff4 100644 >--- a/dbus/dbus-message.c >+++ b/dbus/dbus-message.c >@@ -4058,6 +4058,9 @@ _dbus_message_loader_return_unix_fds(DBusMessageLoader *loader, > > loader->n_unix_fds += n_fds; > loader->unix_fds_outstanding = FALSE; >+ >+ if (n_fds && loader->unix_fds_change) >+ loader->unix_fds_change (loader->unix_fds_change_data); > #else > _dbus_assert_not_reached("Platform doesn't support unix fd passing"); > #endif >@@ -4205,6 +4208,9 @@ load_message (DBusMessageLoader *loader, > message->n_unix_fds_allocated = message->n_unix_fds = n_unix_fds; > loader->n_unix_fds -= n_unix_fds; > memmove (loader->unix_fds, loader->unix_fds + n_unix_fds, loader->n_unix_fds * sizeof (loader->unix_fds[0])); >+ >+ if (loader->unix_fds_change) >+ loader->unix_fds_change (loader->unix_fds_change_data); > } > else > message->unix_fds = NULL; >@@ -4509,6 +4515,25 @@ _dbus_message_loader_get_pending_fds_count (DBusMessageLoader *loader) > return loader->n_unix_fds; > } > >+/** >+ * Register a function to be called whenever the number of pending file >+ * descriptors in the loader change. >+ * >+ * @param loader the loader >+ * @param callback the callback >+ * @param data the data for the callback >+ */ >+void >+_dbus_message_loader_set_pending_fds_function (DBusMessageLoader *loader, >+ void (* callback) (void *), >+ void *data) >+{ >+#ifdef HAVE_UNIX_FD_PASSING >+ loader->unix_fds_change = callback; >+ loader->unix_fds_change_data = data; >+#endif >+} >+ > static DBusDataSlotAllocator slot_allocator = > _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (message_slots)); > >diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c >index 690e5ba..f63e0ce 100644 >--- a/dbus/dbus-transport.c >+++ b/dbus/dbus-transport.c >@@ -1523,6 +1523,22 @@ _dbus_transport_get_pending_fds_count (DBusTransport *transport) > return _dbus_message_loader_get_pending_fds_count (transport->loader); > } > >+/** >+ * Register a function to be called whenever the number of pending file >+ * descriptors in the loader change. >+ * >+ * @param transport the transport >+ * @param callback the callback >+ */ >+void >+_dbus_transport_set_pending_fds_function (DBusTransport *transport, >+ void (* callback) (void *), >+ void *data) >+{ >+ _dbus_message_loader_set_pending_fds_function (transport->loader, >+ callback, data); >+} >+ > #ifdef DBUS_ENABLE_STATS > void > _dbus_transport_get_stats (DBusTransport *transport, >diff --git a/dbus/dbus-transport.h b/dbus/dbus-transport.h >index ff102f3..39c74c4 100644 >--- a/dbus/dbus-transport.h >+++ b/dbus/dbus-transport.h >@@ -98,6 +98,9 @@ dbus_bool_t _dbus_transport_set_auth_mechanisms (DBusTransport > void _dbus_transport_set_allow_anonymous (DBusTransport *transport, > dbus_bool_t value); > int _dbus_transport_get_pending_fds_count (DBusTransport *transport); >+void _dbus_transport_set_pending_fds_function (DBusTransport *transport, >+ void (* callback) (void *), >+ void *data); > > /* if DBUS_ENABLE_STATS */ > void _dbus_transport_get_stats (DBusTransport *transport, >-- >2.1.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1140527
:
936438
|
936439
| 936441 |
936442