]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: peers: Fix crash when syncing learn state of a peer without appctx
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jul 2024 10:03:41 +0000 (12:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jul 2024 10:14:27 +0000 (12:14 +0200)
commit3e2d1476e65ed45a38ed153ad2357d60755be8e9
treeb5ae953c704af20615b585686f069e0f7bcf8092
parent95f624540b87e06e7a3c36b8c1ed4d76f0add2dc
BUG/MEDIUM: peers: Fix crash when syncing learn state of a peer without appctx

For a given peer, the synchronization of the learn state is no longer
performed in the peer appctx. It is delayed to be handled by the peers sync
task. It means that for a given peer, it is possible to have finished to
learn and only handle it after the appctx release. So the synchronization
may happen on a peer without appctx.

This was not tested and an unconditionnal wakeup on the appctx could lead to
a crash because of a NULL-deref. It may be experienced by running
reg-tests/peers/tls_basic_sync.vtc script in loop. The fix is obivous. In
sync_peer_learn_state(), we must omit to wakeup the appctx if it was already
released.

This patch should fix issue #2629. It must be backported to 3.0.
src/peers.c