]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: tasks: make sure to always lock the shared wait queue if needed
authorWilly Tarreau <w@1wt.eu>
Fri, 17 Jul 2020 12:37:51 +0000 (14:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Jul 2020 12:37:51 +0000 (14:37 +0200)
commit273aea479de6c50a1a4f2cc329aa91ef11f8a829
treee92c6e95e135f6428c3a250f01fde0a14926cc3f
parentad37c7ab257826182c3fb0155d4360833c6ed0f1
BUG/MAJOR: tasks: make sure to always lock the shared wait queue if needed

In run_tasks_from_task_list() we may free some tasks that have been
killed. Before doing so we unlink them from the wait queue. But if such
a task is in the global wait queue, the queue isn't locked so this can
result in corrupting the global task list and causing loops or crashes.

It's very likely one cause of issue #758.

This must be backported to 2.2. For 2.1 there doesn't seem to be any
case where a task could be freed this way while in the global queue,
but it doesn't cost much to apply the same change (the code is in
process_runnable_task there).
src/task.c