Amaury Denoyelle
74b95922ef
BUG/MEDIUM: quic: do not release BE quic-conn prior to upper conn
...
For frontend side, quic_conn is only released if MUX wasn't allocated,
either due to handshake abort, in which case upper layer is never
allocated, or after transfer completion when full conn + MUX layers are
already released.
On the backend side, initialization is not performed in the same order.
Indeed, in this case, connection is first instantiated, the nthe
quic_conn is created to execute the handshake, while MUX is still only
allocated on handshake completion. As such, it is not possible anymore
to free immediately quic_conn on handshake failure. Else, this can cause
crash if the connection try to reaccess to its transport layer after
quic_conn release.
Such crash can easily be reproduced in case of connection error to the
QUIC server. Here is an example of an experienced backtrace.
Thread 1 "haproxy" received signal SIGSEGV, Segmentation fault.
0x0000555555739733 in quic_close (conn=0x55555734c0d0, xprt_ctx=0x5555573a6e50) at src/xprt_quic.c:28
28 qc->conn = NULL;
[ ## gdb ## ] bt
#0 0x0000555555739733 in quic_close (conn=0x55555734c0d0, xprt_ctx=0x5555573a6e50) at src/xprt_quic.c:28
#1 0x00005555559c9708 in conn_xprt_close (conn=0x55555734c0d0) at include/haproxy/connection.h:162
#2 0x00005555559c97d2 in conn_full_close (conn=0x55555734c0d0) at include/haproxy/connection.h:206
#3 0x00005555559d01a9 in sc_detach_endp (scp=0x7fffffffd648) at src/stconn.c:451
#4 0x00005555559d05b9 in sc_reset_endp (sc=0x55555734bf00) at src/stconn.c:533
#5 0x000055555598281d in back_handle_st_cer (s=0x55555734adb0) at src/backend.c:2754
#6 0x000055555588158a in process_stream (t=0x55555734be10, context=0x55555734adb0, state=516) at src/stream.c:1907
#7 0x0000555555dc31d9 in run_tasks_from_lists (budgets=0x7fffffffdb30) at src/task.c:655
#8 0x0000555555dc3dd3 in process_runnable_tasks () at src/task.c:889
#9 0x0000555555a1daae in run_poll_loop () at src/haproxy.c:2865
#10 0x0000555555a1e20c in run_thread_poll_loop (data=0x5555569d1c00 <ha_thread_info>) at src/haproxy.c:3081
#11 0x0000555555a1f66b in main (argc=5, argv=0x7fffffffde18) at src/haproxy.c:3671
To fix this, change the condition prior to calling quic_conn release. If
<conn> member is not NULL, delay the release, similarly to the case when
MUX is allocated. This allows connection to be freed first, and detach
from quic_conn layer through close xprt operation.
No need to backport.
2025-06-20 17:46:10 +02:00
..
2023-08-01 10:49:06 +02:00
2025-01-27 11:11:43 +01:00
2025-05-02 09:40:12 +02:00
2025-04-12 01:29:27 +02:00
2024-07-25 15:39:39 +02:00
2024-09-30 16:55:53 +02:00
2024-11-21 19:58:06 +01:00
2024-11-21 19:58:06 +01:00
2025-04-24 16:22:31 +02:00
2025-06-10 08:16:10 +02:00
2024-10-18 14:30:24 +02:00
2021-07-16 19:18:41 +02:00
2025-04-07 09:38:22 +02:00
2025-04-17 17:38:23 +02:00
2025-06-05 09:59:38 +02:00
2024-10-12 16:29:15 +02:00
2024-10-18 18:42:47 +02:00
2025-05-16 16:43:53 +02:00
2023-02-21 11:44:55 +01:00
2021-07-20 18:03:08 +02:00
2021-09-15 11:07:18 +02:00
2025-04-12 01:29:27 +02:00
2023-10-17 18:51:13 +02:00
2024-09-03 17:49:21 +02:00
2025-04-03 17:19:07 +02:00
2024-07-12 15:27:04 +02:00
2022-08-17 10:45:22 +02:00
2025-04-28 20:21:06 +02:00
2024-10-24 11:32:20 +02:00
2023-05-17 09:33:54 +02:00
2024-12-25 11:53:11 +01:00
2025-04-28 20:21:06 +02:00
2025-02-22 11:32:40 +01:00
2023-04-07 00:46:59 +02:00
2025-06-18 17:02:50 +02:00
2025-04-30 17:17:36 +02:00
2025-06-05 09:59:38 +02:00
2025-06-05 09:59:38 +02:00
2025-03-31 16:21:37 +02:00
2025-03-14 18:33:16 +01:00
2023-07-20 11:01:09 +02:00
2025-03-31 16:21:37 +02:00
2025-04-17 16:25:47 +02:00
2025-05-13 18:15:33 +02:00
2024-03-05 11:50:34 +01:00
2022-03-04 08:58:32 +01:00
2022-03-04 08:58:32 +01:00
2024-03-25 17:34:19 +00:00
2024-03-25 17:34:19 +00:00
2025-04-29 21:20:54 +02:00
2021-05-09 06:50:46 +02:00
2024-05-10 17:18:13 +02:00
2024-05-15 19:37:12 +02:00
2023-05-11 12:02:21 +02:00
2024-11-29 07:22:18 +01:00
2024-11-07 11:35:55 +01:00
2024-09-03 17:49:21 +02:00
2025-02-26 13:00:18 +01:00
2025-06-10 15:10:56 +02:00
2024-10-22 20:13:00 +02:00
2025-02-21 18:26:29 +01:00
2023-10-26 15:18:48 +02:00
2025-05-21 15:47:42 +02:00
2025-01-20 17:53:55 +01:00
2024-04-05 15:40:42 +02:00
2024-11-07 18:17:03 +01:00
2025-04-02 11:12:20 +02:00
2025-04-22 16:14:47 +02:00
2023-08-08 19:10:54 +02:00
2022-05-30 09:59:26 +02:00
2022-05-30 09:59:26 +02:00
2024-05-16 10:31:17 +02:00
2024-11-29 07:22:32 +01:00
2025-04-03 17:52:17 +02:00
2025-04-30 17:00:27 +02:00
2021-11-18 10:50:58 +01:00
2025-04-02 11:12:20 +02:00
2023-01-13 11:22:13 +01:00
2024-04-29 17:10:47 +02:00
2024-03-05 11:50:34 +01:00
2023-01-27 15:18:59 +01:00
2023-01-27 15:18:59 +01:00
2024-04-04 19:10:01 +02:00
2023-01-27 15:18:59 +01:00
2023-05-11 15:37:04 +02:00
2024-11-19 15:29:40 +01:00
2025-05-12 18:02:47 +02:00
2024-10-17 13:54:54 +02:00
2024-10-17 13:54:54 +02:00
2025-03-03 12:43:32 +01:00
2025-04-15 15:49:44 +02:00
2022-04-14 16:57:12 +02:00
2024-04-24 15:54:55 +02:00
2025-04-01 11:57:55 +02:00
2024-03-05 11:50:34 +01:00
2021-10-14 16:38:14 +02:00
2021-10-07 01:41:14 +02:00
2021-05-31 10:55:51 +02:00
2021-10-07 01:41:14 +02:00
2021-10-07 01:41:14 +02:00
2025-04-17 17:38:23 +02:00
2024-03-29 17:08:37 +01:00
2024-03-29 17:08:37 +01:00
2024-12-25 12:33:06 +01:00
2024-11-21 19:55:21 +01:00
2024-12-10 16:04:11 +01:00
2024-12-10 16:04:11 +01:00
2025-05-26 19:00:00 +02:00
2024-09-25 17:12:11 +02:00
2024-11-06 10:21:15 +01:00
2025-04-23 15:32:46 +02:00
2024-06-17 19:37:29 +02:00
2024-06-17 19:37:29 +02:00
2024-08-30 14:58:59 +02:00
2025-02-03 07:49:50 +01:00
2025-01-31 10:41:49 +01:00
2025-04-17 14:49:36 +02:00
2025-06-18 17:25:27 +02:00
2025-06-18 17:25:27 +02:00
2025-05-13 19:51:40 +02:00
2024-10-16 22:02:39 +02:00
2024-11-25 15:20:24 +01:00
2021-10-07 01:41:14 +02:00
2022-08-06 17:12:51 +02:00
2022-11-29 15:14:39 +01:00
2024-04-16 07:37:28 +02:00
2024-07-25 15:39:39 +02:00
2024-07-25 15:39:39 +02:00
2025-05-20 15:00:06 +02:00
2024-11-29 07:22:25 +01:00
2025-04-03 11:37:25 +02:00
2024-05-03 09:01:36 +02:00
2023-12-21 14:22:27 +01:00
2022-12-08 17:32:57 +01:00
2025-05-09 14:57:00 +02:00
2024-10-24 16:12:46 +02:00
2021-05-31 10:50:32 +02:00
2025-04-29 15:19:32 +02:00
2023-11-23 17:38:58 +01:00
2024-07-11 15:14:06 +02:00
2024-03-05 11:50:34 +01:00
2023-04-23 09:46:15 +02:00
2024-03-05 11:50:34 +01:00
2024-04-16 07:37:28 +02:00
2024-10-29 12:14:50 +01:00
2024-08-30 18:53:49 +02:00
2025-06-02 17:51:21 +02:00
2025-06-05 09:59:38 +02:00
2025-03-07 12:06:26 +01:00
2024-08-07 15:40:52 +02:00
2024-05-16 10:31:17 +02:00
2025-06-16 18:11:09 +02:00
2024-05-16 10:31:17 +02:00
2024-03-05 11:50:34 +01:00
2022-03-04 08:58:32 +01:00
2024-03-05 11:50:34 +01:00
2025-01-28 12:49:41 +01:00
2024-03-05 11:50:34 +01:00
2024-03-05 11:50:34 +01:00
2024-12-13 14:42:43 +01:00
2024-04-02 18:47:19 +02:00
2025-04-29 15:10:06 +02:00
2025-04-29 15:19:32 +02:00
2024-07-03 15:02:40 +02:00
2024-07-03 15:02:40 +02:00
2023-07-27 10:51:03 +02:00
2025-06-20 17:46:10 +02:00
2025-06-11 18:37:34 +02:00
2025-02-12 11:51:09 +01:00
2024-01-31 16:28:54 +01:00
2024-01-31 16:28:54 +01:00
2025-02-14 09:00:05 +01:00
2025-02-14 09:00:05 +01:00
2024-02-14 11:32:29 +01:00
2024-11-20 17:34:22 +01:00
2023-11-23 16:23:14 +01:00
2023-12-21 16:33:06 +01:00
2025-04-02 11:12:20 +02:00
2025-01-23 17:40:48 +01:00
2024-08-07 10:57:10 +02:00
2023-11-28 15:47:18 +01:00
2024-07-25 15:39:39 +02:00
2024-11-06 14:29:14 +01:00
2025-06-11 18:37:34 +02:00
2024-07-25 15:39:39 +02:00
2025-06-11 18:37:34 +02:00
2023-07-27 10:51:03 +02:00
2025-06-11 18:37:34 +02:00
2023-11-09 16:23:52 +01:00
2022-05-30 09:59:26 +02:00
2025-05-13 15:44:22 +02:00
2024-10-04 17:56:45 +02:00
2024-08-30 17:04:09 +02:00
2025-05-20 15:00:06 +02:00
2024-08-30 17:04:09 +02:00
2025-05-07 15:19:52 +02:00
2025-06-11 18:37:34 +02:00
2025-05-20 15:00:06 +02:00
2024-08-07 15:40:52 +02:00
2025-03-24 10:01:46 +01:00
2025-01-30 18:12:40 +01:00
2024-11-28 21:39:05 +01:00
2025-05-21 14:44:27 +02:00
2025-05-13 15:41:41 +02:00
2025-05-21 14:17:41 +02:00
2024-01-02 11:44:42 +01:00
2021-08-28 12:49:58 +02:00
2025-04-24 17:52:28 +02:00
2025-04-24 17:52:28 +02:00
2025-04-08 14:36:35 +02:00
2025-04-08 14:36:35 +02:00
2023-07-03 16:32:01 +02:00
2024-02-20 15:18:39 +01:00
2025-04-02 11:12:20 +02:00
2025-06-11 18:37:34 +02:00
2025-06-11 18:37:19 +02:00
2024-05-22 10:01:57 +02:00
2024-06-26 15:05:06 +02:00
2023-11-23 16:23:14 +01:00
2024-04-24 10:25:38 +02:00
2022-11-24 08:32:27 +01:00
2021-09-15 11:07:18 +02:00
2025-02-21 11:22:35 +01:00
2024-10-10 16:55:15 +02:00
2025-05-09 15:45:44 +02:00
2024-10-29 12:15:09 +01:00
2022-01-28 19:04:02 +01:00
2025-06-11 18:37:34 +02:00
2025-04-02 11:12:20 +02:00
2024-07-24 14:19:10 +02:00
2025-04-16 17:12:43 +02:00
2025-06-11 18:37:34 +02:00
2021-10-07 01:41:14 +02:00
2025-02-17 18:26:37 +01:00
2025-01-24 12:31:07 +01:00
2024-12-19 10:53:05 +01:00
2025-04-12 01:29:27 +02:00
2025-05-09 14:00:39 +02:00
2025-04-30 11:11:26 +02:00
2025-04-30 11:11:26 +02:00
2025-05-02 16:01:32 +02:00
2024-04-26 11:34:02 +02:00
2024-05-03 09:01:36 +02:00
2024-04-18 17:04:08 +02:00
2024-04-19 01:54:00 +02:00
2024-04-18 17:04:08 +02:00
2024-05-02 16:43:26 +02:00
2025-06-05 09:58:58 +02:00
2025-06-02 17:51:08 +02:00
2025-05-16 15:11:37 +02:00
2025-01-31 10:41:50 +01:00
2025-05-02 15:27:55 +02:00
2024-09-03 17:49:21 +02:00
2025-04-11 16:09:17 +02:00
2025-06-05 09:59:38 +02:00
2024-12-12 11:19:10 +01:00
2024-04-03 15:53:18 +02:00
2025-04-30 17:08:57 +02:00
2025-04-30 17:09:06 +02:00
2025-04-02 14:57:40 +02:00
2024-07-12 15:27:04 +02:00
2025-04-29 15:10:06 +02:00
2025-05-05 18:36:12 +02:00
2021-10-07 01:41:14 +02:00
2024-08-07 15:40:52 +02:00
2024-08-07 15:40:52 +02:00
2023-08-01 10:48:28 +02:00
2025-04-28 16:50:34 +02:00
2023-04-13 16:57:51 +02:00
2024-12-03 19:45:08 +01:00
2025-05-09 19:12:05 +02:00
2025-01-10 14:50:59 +01:00
2024-12-18 09:52:06 +01:00
2024-11-14 15:03:38 +01:00
2024-11-14 15:03:38 +01:00
2021-05-11 17:24:32 +02:00
2024-09-15 23:51:51 +02:00
2024-09-15 23:51:51 +02:00
2024-04-17 11:14:44 +02:00
2025-05-28 16:46:34 +02:00
2024-12-13 14:42:43 +01:00
2024-03-05 11:50:34 +01:00
2021-09-11 20:37:50 +02:00