From 2d0f873cd8011edd819d3192c9fc3723f732b85e Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 3 Mar 2022 18:04:24 +0100 Subject: [PATCH] BUG/MINOR: quic: fix segfault on CC if mux uninitialized A segfault happens when receiving a CONNECTION_CLOSE during handshake. This is because the mux is not initialized at this stage but the transport layer dereferences it. Fix this by ensuring that the MUX is initialized before. Thanks to Willy for his help on this one. Welcome in the QUIC-men team ! --- src/xprt_quic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 5c260eaab..34c4811a0 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -2393,9 +2393,10 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct case QUIC_FT_CONNECTION_CLOSE: case QUIC_FT_CONNECTION_CLOSE_APP: /* warn the mux to close the connection */ - if (qc->mux_state == QC_MUX_READY) + if (qc->mux_state == QC_MUX_READY) { qc->qcc->flags |= QC_CF_CC_RECV; - tasklet_wakeup(qc->qcc->wait_event.tasklet); + tasklet_wakeup(qc->qcc->wait_event.tasklet); + } break; case QUIC_FT_HANDSHAKE_DONE: if (qc_is_listener(ctx->qc))