]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: sink: bad init sequence on tcp sink from a ring.
authorEmeric Brun <ebrun@haproxy.com>
Tue, 13 Sep 2022 14:16:30 +0000 (16:16 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 13 Sep 2022 15:03:30 +0000 (17:03 +0200)
commitd6e581de4be1d3564d771056303242c9ae930c40
treeb700472337ea7dc7dd7a79b0d7f054d96f3150be
parentebf600a8384040a023b5278c1005ee1a2c04d712
BUG/MEDIUM: sink: bad init sequence on tcp sink from a ring.

The init of tcp sink, particularly for SSL, was done
too early in the code, during parsing, and this can cause
a crash specially if nbthread was not configured.

This was detected by William using ASAN on a new regtest
on log forward.

This patch adds the 'struct proxy' created for a sink
to a list and this list is now submitted to the same init
code than the main proxies list or the log_forward's proxies
list. Doing this, we are assured to use the right init sequence.
It also removes the ini code for ssl from post section parsing.

This patch should be backported as far as v2.2

Note: this fix uses 'goto' labels created by commit
'BUG/MAJOR: log-forward: Fix log-forward proxies not fully initialized'
but this code didn't exist before v2.3 so this patch needs to be
adapted for v2.2.
include/haproxy/sink.h
src/cfgparse.c
src/sink.c