From 4b351918b9f70eaedbdb3ab39208bc1f131efae0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 27 Sep 2012 21:35:22 -0400 Subject: [PATCH] hardening: Ensure _dbus_check_setuid() is initialized threadsafe manner This is a highly theoretical concern, but we might as well. https://bugs.freedesktop.org/show_bug.cgi?id=52202 --- dbus/dbus-sysdeps-pthread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c index c9ec9e5bc..c60457bee 100644 --- a/dbus/dbus-sysdeps-pthread.c +++ b/dbus/dbus-sysdeps-pthread.c @@ -275,6 +275,11 @@ check_monotonic_clock (void) dbus_bool_t _dbus_threads_init_platform_specific (void) { + /* These have static variables, and we need to handle both the case + * where dbus_threads_init() has been called and when it hasn't; + * so initialize them before any threads are allowed to enter. + */ check_monotonic_clock (); + (void) _dbus_check_setuid (); return dbus_threads_init (NULL); } -- 2.47.3