From e1d91497c99fb2bfb420781d2b1dbb804a0639b8 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 4 Jun 2025 11:26:52 -0600 Subject: [PATCH] lua/output: access luastate within lock Fixes Coverity issue: CID 1648445: (#1 of 1): Data race condition (MISSING_LOCK) 4. missing_lock: Accessing td->lua_ctx->luastate without holding lock LogLuaCtx_.m. Elsewhere, LogLuaCtx_.luastate is written to with LogLuaCtx_.m held 41 out of 41 times. --- src/output-lua.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/output-lua.c b/src/output-lua.c index 3e1edaef32..6f63fb1a70 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -126,9 +126,8 @@ static int LuaStreamingLogger(ThreadVars *tv, void *thread_data, const Flow *f, } LogLuaThreadCtx *td = (LogLuaThreadCtx *)thread_data; - lua_State *luastate = td->lua_ctx->luastate; - SCMutexLock(&td->lua_ctx->m); + lua_State *luastate = td->lua_ctx->luastate; LuaStateSetThreadVars(luastate, tv); if (flags & OUTPUT_STREAMING_FLAG_TRANSACTION)