From: Olivier Houchard Date: Wed, 17 Jun 2020 18:32:34 +0000 (+0200) Subject: BUG/MEDIUM: fd: Don't fd_stop_recv() a fd we don't own. X-Git-Tag: v2.2-dev10~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d7b5178240b05f3afab073ad606b40f27d538f2;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: fd: Don't fd_stop_recv() a fd we don't own. In fd_takeover(), if we failed to grab the fd, when a double-width compare-and-swap is not implemented, do not call fd_stop_recv() on the fd, it is not ours and may be used by another thread. --- diff --git a/src/fd.c b/src/fd.c index b0a16841e0..1fcf1d43c7 100644 --- a/src/fd.c +++ b/src/fd.c @@ -362,7 +362,8 @@ end: * the fd is polled by the thread that used to own it, the new thread * is supposed to call subscribe() later, to activate polling. */ - fd_stop_recv(fd); + if (ret != -1) + fd_stop_recv(fd); return ret; #else unsigned long old_masks[2];