BUG/MINOR: quic: ensure a detached coalesced packet can't access its neighbours
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 21 Jan 2025 14:49:51 +0000 (15:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Jan 2025 10:33:09 +0000 (11:33 +0100)
commite9ee3ffed01823ee1724b223f14dae4383db72e3
tree94375328990c684900cdb297ab618737b94a292f
parent765f3beffcc88fcb4b342b8acd80bce05e96f9ea
BUG/MINOR: quic: ensure a detached coalesced packet can't access its neighbours

Reset ->prev and ->next fields of a coalesced TX packet to ensure it cannot access
several times its neighbours after it is supposed to be detached from them calling
quic_tx_packet_dgram_detach().

There are two cases where a packet can be coalesced to another previous built one:
this is when it is built into the same datagrame without GSO (and flagged flag with
QUIC_FL_TX_PACKET_COALESCED) or when sent from the same sendto() syscall with GOS
(not flagged with QUIC_FL_TX_PACKET_COALESCED).

This fix may be in relation with GH #2839.

Must be backported as far as 2.6.

(cherry picked from commit cb729fb64d18815fd73e48d24f0d58a830aee63c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d3eb23c684269d22a5d9059b38018c76c4926c3b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/quic_tx.h