BUG/MEDIUM: lists: Avoid an infinite loop in MT_LIST_TRY_ADDQ().
authorOlivier Houchard <cognet@ci0.org>
Thu, 18 Feb 2021 22:55:30 +0000 (23:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Feb 2021 15:47:20 +0000 (16:47 +0100)
commit5567f41d0ab61dd6843535edc8081407d599024d
treed750e0f4bc5b7d4e645bb4f0c5cf4fdd86633f19
parentd8ea18805885d886bcf9f77f8dff9902e2043c55
BUG/MEDIUM: lists: Avoid an infinite loop in MT_LIST_TRY_ADDQ().

In MT_LIST_TRY_ADDQ(), deal with the "prev" field of the element before the
"next". If the element is the first in the list, then its next will
already have been locked when we locked list->prev->next, so locking it
again will fail, and we'll start over and over.

This should be backported to 2.3.
include/haproxy/list.h