BUG/MEDIUM: peers: fix partial message decoding
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 Dec 2023 08:21:38 +0000 (09:21 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 Dec 2023 08:28:53 +0000 (09:28 +0100)
commita7777bbf79352e6670eab0b6afbebded6fbc6bdb
tree80145810765d1abe0dd6855c8b0f22faf62ed3cc
parent89807a76d6d73c62e18e1a2b4804371f06268933
BUG/MEDIUM: peers: fix partial message decoding

peer_recv_msg() may return because the message is incomplete without
checking if a shutdown is pending for the SC. The function relies on
co_getblk() to detect shutdowns. However, the message length decoding may be
interrupted if the multi-bytes integer is incomplete. In this case, the SC
is not check for shutdowns.

When this happens, this leads to an appctx spinning loop.

This patch should fix the issue #2373. It must be backported to 2.8.
src/peers.c