]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: Possible crash when inspecting the xprt context
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 23 Nov 2021 14:59:59 +0000 (15:59 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 30 Nov 2021 10:50:42 +0000 (11:50 +0100)
commitd77c50b6d6b808f57f62db8078f54715769eeb6c
tree7b457c12d06a2a3e6d14b90373cc2e5c4c6c1ee0
parente2660e61e271bf90c8e4d9a5ceb3c743e1ec36a4
MINOR: quic: Possible crash when inspecting the xprt context

haproxy may crash when running this statement in qc_lstnr_pkt_rcv():
conn_ctx = qc->conn->xprt_ctx;
because qc->conn may not be initialized. With this patch we ensure
qc->conn is correctly initialized before accessing its ->xprt_ctx
members. We zero the xrpt_ctx structure (ssl_conn_ctx struct), then
initialize its ->conn member with HA_ATOMIC_STORE. Then, ->conn and
->conn->xptr_ctx members of quic_conn struct can be accessed with HA_ATOMIC_LOAD()
src/xprt_quic.c