From: Christopher Faulet Date: Wed, 5 Feb 2025 14:06:45 +0000 (+0100) Subject: BUG/MEDIUM: mux-fcgi: Propagate flags to SE in fcgi_strm_wake_one_stream X-Git-Tag: v3.2-dev5~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b1c2277ae61c161baed8182ad5416714a62272f;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-fcgi: Propagate flags to SE in fcgi_strm_wake_one_stream The commit is flagged as a bug because the same fix on the H2 multiplexer was reported as a bug. But no issue was reported. When a stream is explicitly woken up by the FCGI conneciton, if an error condition is detected, the corresponding error flag is set on the SE. So SE_FL_ERROR or SE_FL_ERR_PENDING, depending if the end of stream was reported or not. However, there is no attempt to propagate other termination flags. We must be sure to properly set SE_FL_EOI and SE_FL_EOS when appropriate to be able to switch a pending error to a fatal error. Because of this bug, the SE could remain with a pending error and no end of stream, preventing the applicative stream to trully abort it. It means on some abort scenario, it seems to be possible to block a stream infinitely. This patche depends on: * MEDIUM: mux-fcgi: Add a function to propagate termination flags from fstrm to SE * BUG/MEDIUM: mux-fcgi: Properly handle read0 on partial records This patch could be backported at least as far as 2.8 after a period of observation. However no bug was reportedn so there is no rush. --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index bd6efc20e..7a8ceef5b 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -1110,7 +1110,7 @@ static void fcgi_strm_wake_one_stream(struct fcgi_strm *fstrm) if (fconn->state == FCGI_CS_CLOSED || (fconn->flags & (FCGI_CF_ERR_PENDING|FCGI_CF_ERROR))) { se_fl_set_error(fstrm->sd); - + fcgi_strm_propagate_term_flags(fconn, fstrm); if (fstrm->state < FCGI_SS_ERROR) { fstrm->state = FCGI_SS_ERROR; TRACE_STATE("switching to ERROR", FCGI_EV_STRM_WAKE|FCGI_EV_FSTRM_END, fconn->conn, fstrm);