]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua: improper lock usage in hlua_filter_new()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 4 Mar 2024 10:25:47 +0000 (11:25 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 4 Mar 2024 15:47:18 +0000 (16:47 +0100)
commitd81c2205a30cad57fa4e38a019417b85e097a5c8
tree9e9d8aceb3800411a3343ebc83d16f9ea570653d
parent51f291c795570d7da9cc230616a41d55eca93f1a
BUG/MINOR: hlua: improper lock usage in hlua_filter_new()

In hlua_filter_new(), after each hlua resume, we systematically try to
empty the stack by calling lua_settop(). However we're doing this without
locking the lua context, so it is unsafe in multithreading context if the
script is loaded using 'lua-load'. To fix the issue, we protect the call
with hlua_{lock,unlock}() helpers.

This should be backported up to 2.6.
src/hlua.c