Skip to content

Commit 30fb3ca

Browse files
committed
BUG/MINOR: quic: prevent crash on qc_kill_conn()
Ensure idle_timer task is allocated in qc_kill_conn() before waking it up. It can be NULL if idle timer has already fired but MUX layer is still present, which prevents immediate quic_conn release. qc_kill_conn() is only used on send() syscall fatal error to notify upper layer of an error and close the whole connection asap. This crash occurence is pretty rare as it relies on timing issues. It happens only if idle timer occurs before the MUX release (a bigger client timeout is thus required) and any send() syscall detected error. For now, it was only reproduced using GDB to interrupt haproxy longer than the idle timeout. This should be backported up to 2.6. (cherry picked from commit f7ae84e) Signed-off-by: Amaury Denoyelle <[email protected]>
1 parent 91d9c43 commit 30fb3ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/quic_conn.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ void qc_kill_conn(struct quic_conn *qc)
161161
TRACE_PROTO("killing the connection", QUIC_EV_CONN_KILL, qc);
162162
qc->flags |= QUIC_FL_CONN_TO_KILL;
163163
qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED;
164-
task_wakeup(qc->idle_timer_task, TASK_WOKEN_OTHER);
164+
165+
if (!(qc->flags & QUIC_FL_CONN_EXP_TIMER))
166+
task_wakeup(qc->idle_timer_task, TASK_WOKEN_OTHER);
165167

166168
qc_notify_err(qc);
167169

0 commit comments

Comments
 (0)