]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: missing lock in hlua_filter_new()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 11 Mar 2024 12:50:41 +0000 (13:50 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 13 Mar 2024 08:24:46 +0000 (09:24 +0100)
This is a complementary patch to 8670db7 ("BUG/MAJOR: hlua: improper lock
usage with hlua_ctx_resume()") for hlua_filter_new().

Indeed, the HLUA_E_ERRMSG case still relies on the lua stack but didn't
take the lock to do so.

This should be backported up to 2.6.

src/hlua.c

index 9578923be9cc38be0bfb7f264005e4948f486c76..4dfee0ea01911f7f2f166721241767908583fe84 100644 (file)
@@ -11989,7 +11989,9 @@ static int hlua_filter_new(struct stream *s, struct filter *filter)
                filter->ctx = flt_ctx;
                break;
        case HLUA_E_ERRMSG:
+               hlua_lock(s->hlua);
                SEND_ERR(s->be, "Lua filter '%s' : %s.\n", conf->reg->name, hlua_tostring_safe(s->hlua->T, -1));
+               hlua_unlock(s->hlua);
                ret = -1;
                goto end;
        case HLUA_E_ETMOUT: