BUG/MINOR: quic: Possible crashes in qc_idle_timer_task()
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 5 Apr 2023 07:44:21 +0000 (09:44 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 5 Apr 2023 09:03:20 +0000 (11:03 +0200)
commitce5c145df5cd77a8a79ab0980c8a5c8010128abc
tree87d0111af54531e70376da53489d4315254c58f4
parent2954bcc1e85479e777f55e80877110516e034fd2
BUG/MINOR: quic: Possible crashes in qc_idle_timer_task()

This is due to this commit:

    MINOR: quic: Add trace to debug idle timer task issues

where has been added without having been tested at developer level.
<qc> was dereferenced after having been released by qc_conn_release().

Set qc to NULL value after having been released to forbid its dereferencing.
Add a check for qc->idle_timer_task in the traces added by the mentionned
commit above to prevent its dereferencing if NULL.
Take the opportunity of this patch to modify trace events from
QUIC_EV_CONN_SSLALERT to QUIC_EV_CONN_IDLE_TIMER.

Must be backported to 2.6 and 2.7.
src/quic_conn.c