]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: listener: do not try to rebind another process' socket
authorWilly Tarreau <w@1wt.eu>
Wed, 15 Mar 2017 11:47:46 +0000 (12:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 15 Mar 2017 11:47:46 +0000 (12:47 +0100)
commit3569df3fcf770d6785b32a39c0ff0c3d2a180f44
tree1e57529f7af05b88a14ffe4c34daa6aec156abf8
parenta84a2dba946bd49676f5222d49eca8d40346e53c
BUG/MEDIUM: listener: do not try to rebind another process' socket

When the "process" setting of a bind line limits the processes a
listening socket is enabled on, a "disable frontend" operation followed
by an "enable frontend" triggers a bug because all declared listeners
are attempted to be bound again regardless of their assigned processes.
This can at minima create new sockets not receiving traffic, and at worst
prevent from re-enabling a frontend if it's bound to a privileged port.

This bug was introduced by commit 1c4b814 ("MEDIUM: listener: support
rebinding during resume()") merged in 1.6-dev1, trying to perform the
bind() before checking the process list instead of after.

Just move the process check before the bind() operation to fix this.
This fix must be backported to 1.7 and 1.6.

Thanks to Pavlos for reporting this one.
src/listener.c