Skip to content

Commit 078cb85

Browse files
a-denoyellecapflam
authored andcommitted
BUG/MINOR: quic: fix BUG_ON() on Tx pkt alloc failure
On quic_tx_packet allocation failure, it is possible to trigger BUG_ON() crash on INITIAL packet building. This statement is responsible to ensure INITIAL packets are padded to 1.200 bytes as required. If a packet on higher encryption level allocation fails, PADDING frame cannot properly encoded, despite the INITIAL packet properly built. This crash happens due to qc_txb_store() invokation after quic_tx_packet allocation failure to validate already built packets. However, this statement is unneeded as qc_purge_tx_buf() is called just after. Simply remove qc_txb_store() to fix this issue. This was detected using -dMfail. This should be backported up to 2.6. (cherry picked from commit d5376b7) [cf: ctx adjt] Signed-off-by: Christopher Faulet <[email protected]>
1 parent 83bd975 commit 078cb85

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/quic_tx.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
601601
probe, cc, &err);
602602
switch (err) {
603603
case -3:
604-
if (first_pkt)
605-
qc_txb_store(buf, dglen, first_pkt);
606604
qc_purge_tx_buf(qc, buf);
607605
goto leave;
608606
case -2:

0 commit comments

Comments
 (0)