From: Willy Tarreau Date: Wed, 7 Apr 2021 18:46:26 +0000 (+0200) Subject: BUG/MAJOR: fd: switch temp values to uint in fd_stop_both() X-Git-Tag: v2.4-dev16~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1197459e0ab79487032b61abda6bb6b5d7f6a85a;p=thirdparty%2Fhaproxy.git BUG/MAJOR: fd: switch temp values to uint in fd_stop_both() With latest commit f50906519 ("MEDIUM: fd: merge fdtab[].ev and state for FD_EV_* and FD_POLL_* into state") one occurrence of a pair of chars was missed in fd_stop_both(), resulting in the operation to fail if the upper flags were set. Interestingly it managed to fail 2 tests in all setups in the CI while all used to work fine on my local machines. Probably that the reason is that the chars had enough room above them for the CAS to fail then refill "old" overwriting the upper parts of the stack, and that thanks to this the subsequent tests worked. With ASAN being used on lots of tests, it very likely caught it but used to only report failed tests with no more info. No backport is needed, as this was never released nor backported. --- diff --git a/include/haproxy/fd.h b/include/haproxy/fd.h index eb7e13a551..26b5962733 100644 --- a/include/haproxy/fd.h +++ b/include/haproxy/fd.h @@ -206,7 +206,7 @@ static inline void fd_stop_send(int fd) /* Disable processing of events on fd for both directions. */ static inline void fd_stop_both(int fd) { - unsigned char old, new; + uint old, new; old = fdtab[fd].state; do {