From: Aurelien DARRAGON Date: Mon, 11 Mar 2024 12:51:03 +0000 (+0100) Subject: BUG/MINOR: hlua: fix missing lock in hlua_filter_delete() X-Git-Tag: v3.0-dev6~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85d81e4d0a3d71c653f2e1fcc76b6cd0f03a09d0;p=thirdparty%2Fhaproxy.git BUG/MINOR: hlua: fix missing lock in hlua_filter_delete() hlua_filter_delete() calls hlua_unref() on the stream hlua stack, but we should own the lock prior to manipulating the stack. This should be backported up to 2.6. --- diff --git a/src/hlua.c b/src/hlua.c index 4dfee0ea01..7f1dfed6da 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -12037,7 +12037,9 @@ static void hlua_filter_delete(struct stream *s, struct filter *filter) { struct hlua_flt_ctx *flt_ctx = filter->ctx; + hlua_lock(s->hlua); hlua_unref(s->hlua->T, flt_ctx->ref); + hlua_unlock(s->hlua); hlua_ctx_destroy(flt_ctx->hlua[0]); hlua_ctx_destroy(flt_ctx->hlua[1]); pool_free(pool_head_hlua_flt_ctx, flt_ctx);