]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream: never allocate connection addresses from signal handler
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 15:45:18 +0000 (16:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 16:41:38 +0000 (17:41 +0100)
commit84d4c948fce4b31220bb9a30cbf676613bbbf4f2
treeda9455179a79c7195a43b434dc8c12186b9508a5
parentddd173355c9c7452ff6ec317c8be6195d25dba2a
BUG/MEDIUM: stream: never allocate connection addresses from signal handler

In __strm_dump_to_buffer(), we call conn_get_src()/conn_get_dst() to try
to retrieve the connection's IP addresses. But this function may be called
from a signal handler to dump a currently running stream, and if the
addresses were not allocated yet, a poll_alloc() will be performed while
we might possibly already be running pools code, resulting in pool list
corruption.

Let's just make sure we don't call these sensitive functions there when
called from a signal handler.

This must be backported at least to 3.1 and ideally all other versions,
along with this previous commit:

  MINOR: tinfo: add a new thread flag to indicate a call from a sig handler
src/stream.c