]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: h3: extend coverage for duplicate SETTINGS ids quic-interop
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 24 Nov 2026 14:43:22 +0000 (15:43 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 24 Nov 2026 15:34:53 +0000 (16:34 +0100)
RFC 9114 forbids the emission of duplicate settings IDs in the same
frame. The receiver may report an error when this occurs.

Settings IDs are expressed as QUIC varint and their range is thus quite
large. As a convenience, only the smallest IDs set is checked, which
matches the most frequent usage.

A mistake in the previous code restricts unnecessarily the check to IDs
less than sizeof long, so typically only IDs from 0 to 7 are really
checked on a 64-bit platform. Fix this by multiplying sizeof() by 8,
covering all IDs up to 63 (31 on a 32-bit platform).

This should be backported up to 2.6 after a period of observation.

src/h3.c

index 50eeb64fc6105f4228d25f5f74ee65867822a801..6eb68400d58a0be2390ca291136b919530dd1231 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1892,7 +1892,7 @@ static ssize_t h3_parse_settings_frm(struct h3c *h3c, const struct buffer *buf,
                 */
 
                /* Ignore duplicate check for ID too big used for GREASE. */
-               if (id < sizeof(mask)) {
+               if (id < (8 * sizeof(mask))) {
                        if (ha_bit_test(id, &mask)) {
                                h3c->err = H3_ERR_SETTINGS_ERROR;
                                return -1;