From: Simon McVittie Date: Tue, 16 Aug 2016 15:12:35 +0000 (+0100) Subject: Log to syslog when pending_fd_timeout is exceeded X-Git-Tag: dbus-1.10.14~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8551c68d962cb821fa9514db9e3f86f7ffa27c6d;p=thirdparty%2Fdbus.git Log to syslog when pending_fd_timeout is exceeded This is either a denial-of-service attempt, a pathological performance problem or a dbus-daemon bug. Sysadmins should be told about any of these. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 [smcv: add units to timeout: it is in milliseconds] Signed-off-by: Simon McVittie (cherry picked from commit 05cb619f0a6a4c9997832cb4acbb26f7a0be66c3) --- diff --git a/bus/connection.c b/bus/connection.c index 95e20a6e1..a1976768f 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -671,6 +671,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 ms)", + d->name != NULL ? d->name : "(null)", + bus_connection_get_loginfo (connection), + limit); + dbus_connection_close (connection); return TRUE; }