From: Christopher Faulet Date: Tue, 27 Sep 2022 07:18:20 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Reset SE descriptor when we fail to create a stream X-Git-Tag: v2.7-dev7~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ab72c66a01ca81aa93cf1f0bd29430db8271792;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Reset SE descriptor when we fail to create a stream If stream_new() fails after the frontend SC is attached, the underlying SE descriptor is not properly reset. Among other things, SE_FL_ORPHAN flag is not set again. Because of this error, a BUG_ON() is triggered when the mux stream on the frontend side is destroyed. Thus, now, when stream_new() fails, SE_FL_ORPHAN flag is set on the SE descriptor and its stream-connector is set to NULL. This patch should solve the issue #1880. It must be backported to 2.6. --- diff --git a/src/stconn.c b/src/stconn.c index 36d19b46fe..3ad075ffd4 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -170,7 +170,9 @@ struct stconn *sc_new_from_endp(struct sedesc *sd, struct session *sess, struct return NULL; if (unlikely(!stream_new(sess, sc, input))) { pool_free(pool_head_connstream, sc); - sc = NULL; + sd->sc = NULL; + se_fl_set(sd, SE_FL_ORPHAN); + return NULL; } se_fl_clr(sd, SE_FL_ORPHAN); return sc;