]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mworker: don't free the wrong child when not found
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 27 Mar 2019 13:19:10 +0000 (14:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Mar 2019 10:36:18 +0000 (11:36 +0100)
commitf94afebb946eb550f1cd1c8159d2ba5d7323e5f3
treec05755fe4db8dfa7aef6af412d528db3f8ff254f
parent5220ef25e3a7e96824760edf4e8e80d176879d76
BUG/MEDIUM: mworker: don't free the wrong child when not found

A bug occurs when the sigchld handler is called and a child which is
not in the process list just left, or with an empty process list.

The child variable won't be set and left as an uninitialized variable or
set to the wrong child entry, which can lead to a free of this
uninitialized variable or of the wrong child.

This can lead to a crash of the master during a stop or a reload.

It is not supposed to happen with a worker which was created by the
master. A cause could be a fork made by a dependency. (openssl, lua ?)

This patch strengthens the case of the missing child by doing the free
only if the child was found.

This patch must be backported to 1.9.
src/haproxy.c