From cdca48b88c02de195d7011cb6e9ac87e52dd863b Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Wed, 3 Dec 2025 11:07:47 +0100 Subject: [PATCH] BUG/MINOR: quic-be: Missing keywords array NULL termination This bug arrived with this commit: MINOR: quic: implement cc-algo server keyword where keywords list with a missing array NULL termination inside was introduced to parse the QUIC backend CC algorithms. Detected by ASAN during ssl/add_ssl_crt-list.vtc execution as follows: *** h1 debug|==4066081==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5562e31dedb8 at pc 0x5562e298951f bp 0x7ffe9f9f2b40 sp 0x7ffe9f9f2b38 *** h1 debug|READ of size 8 at 0x5562e31dedb8 thread T0 **** dT 0.173 *** h1 debug| #0 0x5562e298951e in srv_find_kw src/server.c:789 *** h1 debug| #1 0x5562e2989630 in _srv_parse_kw src/server.c:3847 *** h1 debug| #2 0x5562e299db1f in parse_server src/server.c:4024 *** h1 debug| #3 0x5562e2c86ea4 in cfg_parse_listen src/cfgparse-listen.c:593 *** h1 debug| #4 0x5562e2b0ede9 in parse_cfg src/cfgparse.c:2708 *** h1 debug| #5 0x5562e2c47d48 in read_cfg src/haproxy.c:1077 *** h1 debug| #6 0x5562e2682055 in main src/haproxy.c:3366 *** h1 debug| #7 0x7ff3ff867249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 *** h1 debug| #8 0x7ff3ff867304 in __libc_start_main_impl ../csu/libc-start.c:360 *** h1 debug| #9 0x5562e26858d0 in _start (/home/flecaille/src/haproxy/haproxy+0x2638d0) *** h1 debug| *** h1 debug|0x5562e31dedb8 is located 40 bytes to the left of global variable 'bind_kws' defined in 'src/cfgparse-quic.c:255:28' (0x5562e31dede0) of size 120 *** h1 debug|0x5562e31dedb8 is located 0 bytes to the right of global variable 'srv_kws' defined in 'src/cfgparse-quic.c:264:27' (0x5562e31ded80) of size 56 *** h1 debug|SUMMARY: AddressSanitizer: global-buffer-overflow src/server.c:789 in srv_find_kw *** h1 debug|Shadow bytes around the buggy address: *** h1 debug| 0x0aacdc633d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *** h1 debug| 0x0aacdc633d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *** h1 debug| 0x0aacdc633d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *** h1 debug| 0x0aacdc633d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *** h1 debug| 0x0aacdc633da0: 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 *** h1 debug|=>0x0aacdc633db0: 00 00 00 00 00 00 00[f9]f9 f9 f9 f9 00 00 00 00 *** h1 debug| 0x0aacdc633dc0: 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 *** h1 debug| 0x0aacdc633dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *** h1 debug| 0x0aacdc633de0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 f9 *** h1 debug| 0x0aacdc633df0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 *** h1 debug| 0x0aacdc633e00: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 *** h1 debug|Shadow byte legend (one shadow byte represents 8 application bytes): This should be backported where the commit above is supposed to be backported. --- src/cfgparse-quic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 7ac88f390..be5bc1f84 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -263,6 +263,7 @@ INITCALL1(STG_REGISTER, bind_register_keywords, &bind_kws); static struct srv_kw_list srv_kws = { "QUIC", { }, { { "quic-cc-algo", srv_parse_quic_cc_algo, 1 }, + { NULL, NULL, 0 }, }}; INITCALL1(STG_REGISTER, srv_register_keywords, &srv_kws);