]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: prevent RS/SS on unistream with hq-interop
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 8 Oct 2026 12:54:26 +0000 (14:54 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 16 Oct 2026 08:03:35 +0000 (10:03 +0200)
When app layer has been shut, qcs_new() will immediately abort a new
stream via attach callback.

App proto hq-interop does not define shutdown callback. In this case, it
is expected that the app layer won't reject a new stream during attach.
MUX QUIC is thus responsible to shut the stream itself using
RESET_STREAM + STOP_SENDING.

This causes a protocol violation if the opened stream is unidirectional.
On RESET_STREAM emission, the peer may close the connection on fatal
error, aborting any possibly still active transfers. Fix this by
ensuring only STOP_SENDING is emitted in this case.

In practice, this bug is not encountered today as it only impacts
hq-interop protocol, and uni streams are not used in this case.

This must be backported to 3.4.

src/mux_quic.c

index 3bfac5d955494f8484f932c00e06daa55fff2ae7..7af0ac3039b690628adb969d901f60c135ca13ad 100644 (file)
@@ -239,7 +239,8 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type)
         */
        if (qcc->app_st >= QCC_APP_ST_SHUT && !qcc->app_ops->shutdown) {
                qcc_abort_stream_read(qcs, 0);
-               qcc_reset_stream(qcs, 0, 0);
+               if (!quic_stream_is_uni(qcs->id))
+                       qcc_reset_stream(qcs, 0, 0);
                goto out;
        }
        else if (qcc->app_ops->attach && qcc->app_ops->attach(qcs, qcc->ctx)) {