From: Olivier Houchard Date: Tue, 19 Jun 2018 17:18:43 +0000 (+0200) Subject: BUG/MEDIUM: fd: Don't modify the update_mask in fd_dodelete(). X-Git-Tag: v1.9-dev1~193 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0e60d852a2896d1811f10cbac1c7145f0c2159f;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: fd: Don't modify the update_mask in fd_dodelete(). Only the pollers should remove bits in the update_mask. Removing it will mean if the fd is currently in the global update list, it will never be removed, and while it's mostly harmless in 1.9, in 1.8, only update_mask is checked to know if the fd is already in the list or not, so we can end up trying to add a fd that is already in the list, and corrupt it, which means some fd may not be added to the poller. This should be backported to 1.8. --- diff --git a/src/fd.c b/src/fd.c index aaba1767ef..3b023a8b05 100644 --- a/src/fd.c +++ b/src/fd.c @@ -371,7 +371,6 @@ static void fd_dodelete(int fd, int do_close) port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port); fdinfo[fd].port_range = NULL; fdtab[fd].owner = NULL; - fdtab[fd].update_mask &= ~tid_bit; fdtab[fd].thread_mask = 0; if (do_close) { polled_mask[fd] = 0;