Patches 11 and 12 of the series, attached. Regards, Martin Mirchev
On Wed, Nov 18, 2026 09:05 PM, Martin Mirchev <[email protected]> wrote: > Hi, > > Here are 12 independent BUG/MINOR fixes against current master > (586d0eef7), as git format-patch files. Patches 1 to 10 are attached here, > and 11 and 12 follow in a reply, as my mail client limits the number of > attachments. Each one was reproduced on master before the fix and checked > again after it; the full reg-test suite gives the same result with and > without the series (362 passed, 0 failed). > > 1. intops: decode_varint() accepted more than 10 bytes (shift by 67, UB) > and silently wrapped values >= 2^64. Every value encode_varint() produces > still round-trips. > 2. mux-spop: AGENT-HELLO/DISCONNECT keys were matched by prefix > ("max-frame-size-bogus" counted as max-frame-size). > 3. mqtt: Will QoS 3, QoS or retain without Will, a 3.1.1 password without > a username, and 3.1.1 CONNACK codes > 5 were all accepted as valid. > 4. mux-h2: atoi() in the tune.h2 keywords accepted "16384x", "x" (as 0, > which means unlimited) and empty values. > 5. log: "sample 10-20,5-30:40" (a range enclosing another) passed the > overlap check. > 6. base64: ubase64rev maps '=' to 63, so ub64dec decodes padding as data > ("AB==" gives 00 1f ff). The cause is an off-by-one in > dev/base64/base64rev-gen.c, fixed too. > 7. sample: ungrpc parsed compressed gRPC messages as plain protobuf. > 8. net_helper: the eth.* converters did not skip 802.1ad (0x88a8) tags. > This patch touches lines next to my pending "accept an Ethernet header > ending with the protocol" patch; I can rebase whichever is applied second. > 9. acme: "acme renew" without an argument released ckch_lock without > holding it. > 10. activity: "show profiling tasks|memory <N>" read past the table when N > is larger than it (ASan heap-buffer-overflow; admin level only). > 11. proto_tcp: a TCP_MD5SIG setsockopt() failure did not give the source > port back to the port range. > 12. tools: on x86_64, the CBOR bin encoder wrote integer arguments in > little-endian order. This is 3.5-dev only, since c1abbb11f. > > Backport notes are in each commit message. > > Found by an LLM-assisted tool, verified manually. > > Regards, > Martin Mirchev >
From 9496a3821d049661b51f1a56923bed5e5a0e4cf5 Mon Sep 17 00:00:00 2001 From: Martin Mirchev <[email protected]> Date: Wed, 18 Nov 2026 20:42:42 +0800 Subject: [PATCH 11/12] BUG/MINOR: proto_tcp: release the source port when setting TCP_MD5SIG fails In tcp_connect_server(), every error path after a source port was taken from the "source ... port-range" pool gives it back with port_range_release_port(), except the one taken when setsockopt(TCP_MD5SIG) fails. Each such failure thus permanently removes one port from the range. With setsockopt() forced to fail, a 10-port range is exhausted after 10 connection attempts and the following ones end with "Cannot bind to source address before connect()". When the range is defined on the backend, the other servers of the backend are affected as well. Release the port on this path too. This should be backported to 3.3. --- src/proto_tcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/proto_tcp.c b/src/proto_tcp.c index ec1fe165c..92e590ea3 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -556,6 +556,7 @@ int tcp_connect_server(struct connection *conn, int flags) strlcpy2((char*)md5.tcpm_key, srv->tcp_md5sig, sizeof(md5.tcpm_key)); md5.tcpm_keylen = strlen(srv->tcp_md5sig); if (setsockopt(fd, IPPROTO_TCP, TCP_MD5SIG, &md5, sizeof(md5)) < 0) { + port_range_release_port(src ? src->sport_range : NULL, local_port); conn->flags |= CO_FL_ERROR; return SF_ERR_SRVCL; } -- 2.50.1
From 4fcf53a35e913528b9346289bb36f70d3e9c8093 Mon Sep 17 00:00:00 2001 From: Martin Mirchev <[email protected]> Date: Wed, 18 Nov 2026 20:43:23 +0800 Subject: [PATCH 12/12] BUG/MINOR: tools: always write CBOR uint arguments in network byte order Since commit c1abbb11f ("OPTIM: log/tools: switch from function pointer design to dual mode HEX/BIN design for CBOR encoding"), cbor_encode_uint64_prefix_bin() has an x86_64-only shortcut which memcpy()s the value's bytes as they are in memory. These are in little endian order while RFC8949 #3 requires the argument in network byte order, and with fewer than 8 bytes it writes the low-order ones. So on x86_64 every integer >= 24 in a "%{+cbor,+bin}o" log-format is wrong: a timestamp logged with "%(t:sint)Ts" decodes to a date several days off, while the hex form (cbor_encode_uint64_prefix_hex()) is correct. Drop the shortcut and always use the portable byte-by-byte loop. This is 3.5-dev only, no backport is needed. --- src/tools.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/tools.c b/src/tools.c index 668fcfc00..75ebaa980 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2270,15 +2270,9 @@ char *cbor_encode_uint64_prefix_bin(char *start, char *stop, uint64_t value, if (start + nb_bytes >= stop) return NULL; -#if defined(__x86_64__) - /* we can actually assume the bits are already in proper order - * so let's directly write them as-is on the wire to save CPU - * time. + /* CBOR arguments are in network byte order (RFC8949 #3): encode 1 + * byte at a time from higher bits to lower bits. */ - memcpy(start, &value, nb_bytes); - start += nb_bytes; -#else - /* encode 1 byte at a time from higher bits to lower bits */ while (nb_bytes) { uint8_t cur_byte = (value >> ((nb_bytes - 1) * 8)) & 0xFFU; @@ -2288,7 +2282,6 @@ char *cbor_encode_uint64_prefix_bin(char *start, char *stop, uint64_t value, nb_bytes--; } -#endif return start; } -- 2.50.1

