From: Christopher Faulet Date: Tue, 18 Apr 2023 16:38:32 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Propagate error on the SC on sending path X-Git-Tag: v2.8-dev8~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0c57d3d337c44003c5c1ae49ca6ee472695b5fb;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Propagate error on the SC on sending path On sending path, a pending error can be promoted to a terminal error at the endpoint level (SE_FL_ERR_PENDING to SE_FL_ERROR). When this happens, we must propagate the error on the SC to be able to handle it at the stream level and eventually forward it to the other side. Because of this bug, it is possible to freeze sessions, for instance on the CLI. It is a 2.8-specific issue. No backport needed. --- diff --git a/src/stconn.c b/src/stconn.c index 0cfc4a7e3c..59d2179ace 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1664,6 +1664,8 @@ static int sc_conn_send(struct stconn *sc) if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING)) { oc->flags |= CF_WRITE_EVENT; BUG_ON(sc_ep_test(sc, SE_FL_EOS|SE_FL_ERROR|SE_FL_ERR_PENDING) == (SE_FL_EOS|SE_FL_ERR_PENDING)); + if (sc_ep_test(sc, SE_FL_ERROR)) + sc->flags |= SC_FL_ERROR; return 1; }