From: Jérémie Galarneau Date: Wed, 23 Jan 2019 20:29:14 +0000 (-0500) Subject: Fix: missing rcu read locking in trigger "unregister all" command X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=6bfc8da05c035890b24a6563647ad35afeee0ed8 Fix: missing rcu read locking in trigger "unregister all" command While the notification subsystem all runs within a single thread, the iteration over the triggers hash table must be protected using the RCU read-side lock since the RCU worker may resize the hash table while the iteration is performed. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 4799c7186..81acd7230 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -1572,6 +1572,7 @@ int handle_notification_thread_trigger_unregister_all( struct cds_lfht_iter iter; struct lttng_trigger_ht_element *trigger_ht_element; + rcu_read_lock(); cds_lfht_for_each_entry(state->triggers_ht, &iter, trigger_ht_element, node) { int ret = handle_notification_thread_command_unregister_trigger( @@ -1580,6 +1581,7 @@ int handle_notification_thread_trigger_unregister_all( error_occurred = true; } } + rcu_read_unlock(); return error_occurred ? -1 : 0; }