]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: Possible crashes when dereferencing ->pkt quic_frame struct member
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 18 Aug 2022 15:21:19 +0000 (17:21 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 19 Aug 2022 07:58:28 +0000 (09:58 +0200)
commit1ba25c244e87ecda23060d61c7a2b14958efcef6
treee93cf7ff8f960d818e236ec6df7cc3cb01046cc5
parent473e0e54f5bf48a44c202b367a6da0f0aa0b2a62
BUG/MINOR: quic: Possible crashes when dereferencing ->pkt quic_frame struct member

This was done at several places. First in qc_requeue_nacked_pkt_tx_frms.
This aim of this function is, if needed, to requeue all the TX frames of a lost
<pkt> packet passed as argument and detach them from this packet they have been
sent from. They are possible cases where the frm->pkt quic_frame struct member could
be NULL, as a result of a duplication of an original frame by qc_dup_pkt_frms(). This
function adds the duplicated frame to the original frame reference list:
        LIST_APPEND(&origin->reflist, &dup_frm->ref);
But, in this function, the packet which contains the frame is the one which is passed
as argument (for debug purpose). So let us prefer using this variable.
Also do not dereference this ->pkt quic_frame member in qc_release_frm() and
qc_frm_unref() and add a trace to catch the frame with a null ->pkt member.
They are logically frames which have not already been sent.

Thank you to Tristan for having reported such crashes in GH #1808.

Must be backported to 2.6
src/xprt_quic.c