BUG/MEDIUM: quic: fix crash on CC if mux not present

If a CONNECTION_CLOSE is received during handshake or after mux release,
a segfault happens due to invalid dereferencement of qc->qcc. Check
mux_state first to prevent this.
This commit is contained in:
Amaury Denoyelle 2022-02-15 11:06:15 +01:00
parent 8524f0f779
commit 4af6595d41

View File

@ -2448,6 +2448,7 @@ 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)
qc->qcc->flags |= QC_CF_CC_RECV;
tasklet_wakeup(qc->qcc->wait_event.tasklet);
break;