MINOR: quic: add missing lock on cid tree
All operation on the ODCID/DCID trees must be conducted under a
read-write lock. Add a missing read-lock on the lookup operation inside
listener handler.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 6e30a36..accadb7 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -4115,14 +4115,19 @@
}
cids = &l->rx.cids;
+
+ HA_RWLOCK_RDLOCK(QUIC_LOCK, &l->rx.cids_lock);
node = ebmb_lookup(cids, *buf, QUIC_CID_LEN);
if (!node) {
+ HA_RWLOCK_RDUNLOCK(QUIC_LOCK, &l->rx.cids_lock);
TRACE_PROTO("Packet dropped", QUIC_EV_CONN_LPKT);
goto err;
}
cid = ebmb_entry(node, struct quic_connection_id, node);
qc = cid->qc;
+ HA_RWLOCK_RDUNLOCK(QUIC_LOCK, &l->rx.cids_lock);
+
if (HA_ATOMIC_LOAD(&qc->conn))
conn_ctx = HA_ATOMIC_LOAD(&qc->conn->xprt_ctx);
*buf += QUIC_CID_LEN;