From 4ac4d5607214633f481beda8d7c24eec1803f1a7 Mon Sep 17 00:00:00 2001 From: DMG Date: Thu, 29 Aug 2024 20:55:13 -0700 Subject: [PATCH] Fix: Lock interest_mutex_ When interest_ Modified in ctlEx EventMethEpollEquivImpl::ctlEx now locks interest_mutex_ when performing its add/mod/del actions. Previously, the interest_mutex_ lock was released before these add/mod/del actions were performed. This was confirmed to occasionally cause a "use after free" in findEmEventInAnInterestSet (called out of getReadyEmEvents) in another thread. It might also result in corruption of the interest_ std::set. --- src/common/eventmeth.cc | 2 ++ version.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/eventmeth.cc b/src/common/eventmeth.cc index bd5b114c9..e49fd54da 100644 --- a/src/common/eventmeth.cc +++ b/src/common/eventmeth.cc @@ -4037,6 +4037,8 @@ EmEventTmrFd::EmEventTmrFd(clockid_t clock_id, if (ctl_res == 0) { + GUARD_AND_DBG_LOG(interest_mutex_); + switch(op) { case EvCtlAction::Add: diff --git a/version.txt b/version.txt index 36f87cbe5..57a3b2c0f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.4.1.20240828 +0.4.2.20240829