From: Christopher Faulet Date: Thu, 17 Oct 2024 09:54:54 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Check FF data of SC to perform a shutdown in sc_notify() X-Git-Tag: v3.1-dev11~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fcfed9e231f2bc3963fe6085598970db2174af1;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Check FF data of SC to perform a shutdown in sc_notify() In sc_notify() function, the consumer side of the SC is tested to verify if we must perform a shutdown on the endpoint. To do so, no output data must be present in the buffer and in the iobuf. However, there is a bug here, the iobuf of the opposite SC is tested instead of the one of the current SC. So a shutdown can be performed on the endpoint while there are still output data in the iobuf that must be sent. Concretely, it can only be data blocked in a pipe. Because of this bug, data blocked in the pipe will be never sent. I've not tested but I guess this may block the stream during the client or server timeout. This patch must be backported as far as 2.9. --- diff --git a/src/stconn.c b/src/stconn.c index ab5fe66ddd..ca067d6d0a 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1119,7 +1119,7 @@ void sc_notify(struct stconn *sc) struct task *task = sc_strm_task(sc); /* process consumer side */ - if (!co_data(oc) && !sc_ep_have_ff_data(sco)) { + if (!co_data(oc) && !sc_ep_have_ff_data(sc)) { struct connection *conn = sc_conn(sc); if (((sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED) &&