From ba6d2011e40504039129faca76551f7a97b12c4e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2014 19:07:02 +0000 Subject: [PATCH 04/11] Log to syslog when pending_fd_timeout is exceeded Similarly, this is either a denial-of-service attempt or a pathological performance problem. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 --- bus/connection.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bus/connection.c b/bus/connection.c index f278e61..560483f 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -636,6 +636,18 @@ static dbus_bool_t pending_unix_fds_timeout_cb (void *data) { DBusConnection *connection = data; + BusConnectionData *d = BUS_CONNECTION_DATA (connection); + int limit; + + _dbus_assert (d != NULL); + limit = bus_context_get_pending_fd_timeout (d->connections->context); + bus_context_log (d->connections->context, DBUS_SYSTEM_LOG_WARNING, + "Connection \"%s\" (%s) has had Unix fds pending for too long, " + "closing it (pending_fd_timeout=%d)", + d->name != NULL ? d->name : "(null)", + bus_connection_get_loginfo (connection), + limit); + dbus_connection_close (connection); return TRUE; } -- 2.1.3