Lock the PluginVC mutex in the timeout setters set_active_timeout() and set_inactivity_timeout() cancel and replace the timeout events without a lock. A plugin can call them through TSVConnActiveTimeoutSet() and TSVConnInactivityTimeoutSet() while main_handler() reads, cancels, or schedules the same events on a different thread.
diff --git a/src/proxy/PluginVC.cc b/src/proxy/PluginVC.cc index 0482e78..f017b1f 100644 --- a/src/proxy/PluginVC.cc +++ b/src/proxy/PluginVC.cc
@@ -807,6 +807,8 @@ void PluginVC::set_active_timeout(ink_hrtime timeout_in) { + SCOPED_MUTEX_LOCK(lock, mutex, this_ethread()); + active_timeout = timeout_in; // FIX - Do we need to handle the case where the timeout is set @@ -825,6 +827,8 @@ void PluginVC::set_inactivity_timeout(ink_hrtime timeout_in) { + SCOPED_MUTEX_LOCK(lock, mutex, this_ethread()); + inactive_timeout = timeout_in; if (inactive_timeout != 0) { inactive_timeout_at = ink_get_hrtime() + inactive_timeout;