]> git.kaiwu.me - haproxy.git/log
haproxy.git
13 days agoBUG/MEDIUM: acme: fix segfault on newOrder with empty authorizations
William Lallemand [Wed, 29 Apr 2026 16:04:27 +0000 (18:04 +0200)]
BUG/MEDIUM: acme: fix segfault on newOrder with empty authorizations

When an ACME server returns a newOrder response with an empty
authorizations array (certificate already validated), ctx->auths
remains NULL. The state machine then transitions to ACME_AUTH which
immediately dereferences ctx->next_auth, causing a segfault.

Return an error from acme_res_neworder() so the caller retries.

This needs to be backported to 3.2.

13 days ago[RELEASE] Released version 3.4-dev10 v3.4-dev10
Willy Tarreau [Wed, 29 Apr 2026 13:51:32 +0000 (15:51 +0200)]
[RELEASE] Released version 3.4-dev10

Released version 3.4-dev10 with the following main changes :
    - DOC: config: fix spelling of "max-threads-per-group" in the index
    - MEDIUM: threads: change the default max-threads-per-group value to 16
    - BUG/MEDIUM: mux-h2: ignore conn->owner when deciding if a connection is dead
    - BUG/MINOR: task: fix uninitialised read in run_tasks_from_lists()
    - MINOR: compression: prefix compression oriented functions with "comp_"
    - BUG/MINOR: mux_quic: limit avail_streams() to 2^62
    - MINOR: h3: simplify GOAWAY local emission
    - MEDIUM: h3: prevent new streams on GOAWAY reception
    - MINOR: mux-quic: release BE idle conn after GOAWAY reception
    - MINOR: otel: added debug thread ID support for the OTel C wrapper library
    - MINOR: otel: test: added option parsing to the speed test script
    - MINOR: otel: test: replaced argument variables with positional parameters in run scripts
    - CLEANUP: otel: removed insecure-fork-wanted requirement
    - MINOR: otel: test: unified run scripts into a single symlinked script
    - BUILD: haterm: don't pass size_t to %lu in error messages
    - CI: github: merge Test and Test-musl in VTest.yml
    - CI: Build halog as part of contrib.yml
    - BUG/MINOR: xprt_qstrm: read record length in 64bits
    - BUG/MINOR: mux_quic: convert QCC rx.rlen to 64bits
    - CI: github: revert quictls version on cross-zoo.yml
    - BUG/MINOR: xprt_qstrm: reduce max record length check
    - CI: github: use quictls-3.1.7 for cross-zoo.yml
    - BUILD: ssl/sample: potential null pointer dereference in sample_conv_aes
    - CI: github: add an i686 job in cross-zoo.yml
    - CI: github: run cross-zoo.yml weekly
    - CI: github: add cross-zoo.yml in README.md
    - BUG/MEDIUM: checks: Don't forget to set the "alt_proto" field
    - CI: github: do not install pcre-devel on Fedora Rawhide build
    - CI: github: fix sysctl in fedora-rawhide
    - CI: github: switch to USE_PCRE2 in Fedora Rawhide build
    - MINOR: acme: implement draft-ietf-acme-profiles
    - MINOR: acme: allow IP SAN in certificate request
    - BUG/MINOR: log: consider format expression dependencies to decide when to log
    - MINOR: sample: make RQ/RS stats available everywhere
    - BUG/MINOR: sample: adjust dependencies for channel output bytes counters
    - MEDIUM: muxes: always set conn->owner to the session that owns the connection
    - MEDIUM: session: always reset the conn->owner on backend when installing mux
    - CLEANUP: mux-h1: avoid using conn->owner in uncertain areas
    - CLEANUP: mux-h1: remove the unneeded test on conn->owner in h1s_finish_detach()
    - BUG/MAJOR: sched: protect task->expire on 32-bit platforms
    - CI: github: add an i686 job to the push job
    - BUILD: config: also set DEF_MAX_THREADS_PER_GROUP when not using threads
    - reg-tests/ssl/ssl_dh.vtc: fix syntax error
    - ci: modernize actions/upload-artifact@v4
    - BUG/MINOR: reg-tests: make shell syntax errors fatal
    - MINOR: cli: Handle the paylod pattern as a pointer in the cmdline buffer
    - MEDIUM: cli: Make a buffer for the command payload
    - MEDIUM: cli: Add support for dynamically allocated payloads
    - MEDIUM: cli: increase the payload pattern up to 64 bytes
    - MINOR: stream: Move the HTTP txn in an union
    - MINOR: stream: Add flags to identify the stream tansaction when allocated
    - MINOR: stream: Use a pcli transaction to replace pcli_* members
    - CLEANUP: applet: Remove useless shadow pointer from appctx
    - REGTESTS: ssl: mark ssl_dh.vtc as broken
    - BUG/MINOR: mux-h2: count a protocol error when failing to parse a trailer
    - BUG/MINOR: mux-h2: count a proto error when rejecting a stream on parsing error
    - BUG/MEDIUM: tasks: Make sure we don't schedule a task already running
    - BUG/MAJOR: net_helper: ip.fp infinite loop on malformed tcp options
    - BUG/MINOR: h2: make tune.h2.log-errors actually work
    - BUG/MINOR: h2: Don't look at the exclusive bit for PRIORITY frame
    - BUG/MINOR: H2: Don't forget to free shared_rx_bufs on failure
    - BUG/MINOR: log: also wait for the response when logging response headers
    - BUG/MINOR: mux-h1: Fix condition to send null-chunk for bodyless message
    - BUG/MINOR: mux-h1: Fix test to skip trailers from chunked messages
    - BUG/MINOR: http-act: fix a typo in a "del-heeaders-bin" error message
    - CLEANUP: tcpcheck: Fix some typos in comments
    - MINOR: tcpcheck: Rely on free_tcpcheck_ruleset() to deinit tcpchecks
    - BUG/MINOR: tcpcheck: Don't release ruleset when parsing 'spop-check' ruleset
    - BUG/MINOR: tcpcheck: Fix a leak on deinit by releasing ruleset's conf.file
    - CLEANUP: haterm: Fix typos in comments
    - CLEANUP: config: Fix warning about invalid small buffer size
    - CLEANUP: htx: Fix typos in comments
    - CLEANUP: chunk: Fix a typo in a comment
    - CLEANUP: http-client: Fix typos in comments
    - BUG/MEDIUM: tcpcheck: Release temporary small chunk when retrying on http-check
    - CLEANUP: proxy: Fix typos in comments
    - DOC: config: Fix a typo for "external-check" directive
    - CLEANUP: cli: Fix typos in comments
    - BUG/MINOR: stream: Add SF_TXN_HTTP/SF_TXN_PCLI flags in strm_show_flags()
    - REGTESTS: Never reuse server connection in jwt/jws_verify.vtc
    - REGTESTS: Never reuse server connection in server/cli_delete_dynamic_server.vtc
    - BUG/MINOR: compression: properly disable request when setting response
    - BUG/MINOR: servers: fix last_sess date calculation
    - DOC: config: fix typo introduce in max-threads-per-group documentation
    - BUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()
    - BUG/MINOR: debug: properly mark the entire libs archive read-only
    - Revert "BUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()"
    - BUG/MINOR: server: fix a possible leak of an error message in dynamic servers
    - BUG/MAJOR: mux-h2: detect incomplete transfers on HEADERS frames as well
    - BUG/MEDIUM: mux-h1: Force close mode for bodyless message announcing a C-L
    - BUG/MINOR: mux_quic: prevent crash on qc_frm_free() with QMux
    - BUG/MINOR: xprt_qstrm: ensure all local TPs are allocated
    - BUG/MINOR: xprt_qstrm: prevent crash if conn release on MUX wake
    - BUG/MINOR: mux_quic: do not release conn on qcc_recv() for QMux
    - MINOR: xprt_qstrm: remove unused subs
    - MINOR: connection: document conn_create_mux()
    - MINOR: xprt_qstrm: implement close callback
    - MINOR: mux_quic: refactor QMux send frames function
    - MINOR: mux_quic: use dynamic Tx streams buffers for QMux
    - MINOR: mux_quic: use dynamic conn buffers for QMux
    - MINOR: mux_quic/xprt_qstrm: simplify Rx buffer transfer
    - MINOR: mux_quic: receive MAX_STREAMS_BIDI frames in QMux
    - MINOR: mux_quic: handle conn errors on QMux without crash
    - MINOR: mux_quic: handle incomplete QMux record read
    - BUG/MINOR: tcpcheck: Allow connection reuse without prior traffic
    - MINOR: sample: converter for frontend existence check
    - BUG/MEDIUM: stats: fix crash on 'dump stats-file'
    - BUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_ckch.c
    - BUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_sock.c
    - BUG/MINOR: ssl: fix memory leak on realloc failure in acme.ips
    - DOC: config: Fix log-format example with last rule expressions
    - DOC: config: Fix typo in tune.bufsize.large description
    - MEDIUM: ot: emitted deprecation warning at filter init
    - BUILD: ot: emitted deprecation warning at build time
    - BUG/MINOR: ssl: fix double-free on failed realloc in ssl_sock.c
    - BUG/MINOR: tree-wide: fix a few user-visible spelling mistakes from dev7
    - CLEANUP: tree-wide: address various spelling mistakes in comments from -dev7
    - BUG/MINOR: tools: my_memspn/my_memcspn wrong cast causing incorrect byte reading
    - BUG/MINOR: tools: fix memory leak in indent_msg() on out of memory
    - BUG/MINOR: tools: free previously allocated strings on strdup failure in backup_env()
    - BUG/MINOR: sample: fix memory leak in check_when_cond() when ACL is not found
    - BUG/MINOR: sample: fix memory leak in smp_resolve_args error paths
    - BUG/MINOR: sample: fix NULL strm dereference in sample_conv_when
    - BUG/MINOR: peers: fix logical "and" when checking for local in PEER_APP_ST_STARTING
    - BUG/MINOR: peers: fix wrong flag reported twice for dump_flags
    - CLEANUP: peers: fix a few user-visible spelling mistakes
    - CLEANUP: tools: drop upper case check after tolower()
    - CLEANUP: mux-h2: remove duplicate forward declaration of h2s_rxbuf_{head,tail}()
    - CLEANUP: tree-wide: fix around 20 mistakes in comments in h2,tools,peers
    - MINOR: mux_quic: return conn error code in debug string
    - MINOR: mux_quic: display QCS sd on traces
    - MINOR: mux_quic/h3: report termination events at connection level
    - MINOR: mux_quic/h3: report termination events at stream layer
    - BUG/MEDIUM: mux_h1: fix stack buffer overflow in h1_append_chunk_size()
    - BUG/MINOR: http_ana: use scf to report term_evts in http_wait_for_request()
    - MINOR: lb: infrastructure for declarative initialization
    - MEDIUM: lb: use the LB ops tables
    - MINOR: lb: cleanups
    - MINOR: mux_quic: remove superfluous b_size() before b_alloc()
    - BUG/MINOR: mux_quic: free frames emitted with QMux
    - BUILD: 51d: fix bool definition on dummy lib v4
    - CLEANUP: Reapply ist.cocci (4)
    - CLEANUP: Reapply strcmp.cocci (3)
    - CLEANUP: Reapply ha_free.cocci (2)
    - BUG/MAJOR: http-htx: Store new host in a chunk for scheme-based normalization
    - BUG/MEDIUM: http-htx: Don't use data from HTX message to update authority
    - BUG/MEDIUM: http-htx: Loop on full host value during scheme based normalization
    - MEDIUM: http-htx: Make authority update optional when replacing a header value
    - MEDIUM: http-htx: Make authority update optional when adding a header
    - BUG/MAJOR: http: forbid comma character in authority value
    - BUG/MEDIUM: h1: Enforce the authority validation during H1 request parsing
    - BUG/MAJOR: mux-h1: Deal with true 64-bits integer to emit chunks size
    - BUG/MEDIUM: tasks: Do not loop in task_schedule() if a task is running
    - BUG/MINOR: fix various typos and spelling mistakes in user-visible messages
    - CLEANUP: tree-wide: fix comment typos all over the tree (~68)
    - BUG/MINOR: payload: validate minimum keyshare_len in smp_fetch_ssl_keyshare_groups
    - BUG/MINOR: payload: prevent integer overflow in distcc token parsing
    - BUG/MINOR: net_helper: fix out-of-bounds read in tcp_fullhdr_find_opt
    - BUG/MINOR: net_helper: fix out-of-bounds read in sample_conv_tcp_options_list
    - BUG/MINOR: net_helper: fix incomplete decoding in sample_conv_eth_vlan
    - BUG/MEDIUM: mux-fcgi: Properly handle full buffer for FCGI_PARAM record
    - BUG/MINOR: http-htx: Don't normalize emtpy path for OPTIONS requests

13 days agoBUG/MINOR: http-htx: Don't normalize emtpy path for OPTIONS requests
Christopher Faulet [Wed, 29 Apr 2026 13:20:50 +0000 (15:20 +0200)]
BUG/MINOR: http-htx: Don't normalize emtpy path for OPTIONS requests

When the scheme-based normalization is performed, an empty path is
normalized to "/". But as stated in RFC9110#4.2.3, this must not be applied
on OPTIONS requests.

So let's fix the issue by adding a test on the method.

Thanks to @zhanhb for the bug report and the analysis.

This patch should fix the issue #3352. It must be backported as far as 3.0.

13 days agoBUG/MEDIUM: mux-fcgi: Properly handle full buffer for FCGI_PARAM record
Christopher Faulet [Wed, 29 Apr 2026 11:21:28 +0000 (13:21 +0200)]
BUG/MEDIUM: mux-fcgi: Properly handle full buffer for FCGI_PARAM record

The function encoding and sending FCGI_PARAM records was reworked to
properly deal with full buffer. An error must be triggered only when the
parameters cannot be encoded while the mbuf is empty (or the free space is
greater than the max record size). Otherwise we must wait and retry later.

Before, an error was triggered on encoding error if any HTX block was
consumed, regarless the mbuf state. Now, blocks are removed on success
only. So we can wait for more space.

This patch should fix the issue #3346. It should be backported to all stable
versions.

13 days agoBUG/MINOR: net_helper: fix incomplete decoding in sample_conv_eth_vlan
Willy Tarreau [Wed, 29 Apr 2026 07:36:03 +0000 (09:36 +0200)]
BUG/MINOR: net_helper: fix incomplete decoding in sample_conv_eth_vlan

sample_conv_eth_vlan() reads the VLAN TCI at area[idx + 2] without
ensuring there are enough bytes. The original condition 'idx + 4 < data'
breaks when there IS room for more data, leading to an incomplete read
when trying to decode a VLAN ID.

This can be backported where this converter was backported.

13 days agoBUG/MINOR: net_helper: fix out-of-bounds read in sample_conv_tcp_options_list
Willy Tarreau [Wed, 29 Apr 2026 07:31:56 +0000 (09:31 +0200)]
BUG/MINOR: net_helper: fix out-of-bounds read in sample_conv_tcp_options_list

sample_conv_tcp_options_list() uses 'ofs + 1 <= len' to check bounds
before reading the option length field at area[ofs + 1]. When ofs + 1
equals len, this reads one byte past the valid buffer (valid indices are
0 to len-1).

This is the same bug pattern as tcp_fullhdr_find_opt() fixed previously,
and the impact is also almost inexistent.

13 days agoBUG/MINOR: net_helper: fix out-of-bounds read in tcp_fullhdr_find_opt
Willy Tarreau [Wed, 29 Apr 2026 07:31:27 +0000 (09:31 +0200)]
BUG/MINOR: net_helper: fix out-of-bounds read in tcp_fullhdr_find_opt

tcp_fullhdr_find_opt() reads smp->data.u.str.area[next + 1] without
checking that next + 1 < len. When the last byte of a TCP header's
options section (at index len - 1) contains an option type that is not
0 (EOL) and not 1 (NOP), the code reads one byte past the valid buffer,
which is an out-of-bounds read, which in practice is totally harmless
but should be fixed.

This can be backported where tcp_fullhdr_find_opt() was backported.

13 days agoBUG/MINOR: payload: prevent integer overflow in distcc token parsing
Willy Tarreau [Wed, 29 Apr 2026 07:19:57 +0000 (09:19 +0200)]
BUG/MINOR: payload: prevent integer overflow in distcc token parsing

In both smp_fetch_distcc_param() and smp_fetch_distcc_body(), the code
does "ofs += body" without checking if body is larger than the remaining
data. If a malicious distcc packet contains a token with a very large
body length (param value up to 0xFFFFFFFF), ofs could overflow and wrap
around to a small value, causing the next iteration's bounds check
"ofs + 12 > ci_data(chn)" to pass incorrectly.

This could lead to out-of-bounds reads or an infinite loop.

Given that this is only used in trusted environments, this is mostly
harmless. It can be backported to all stable versions.

13 days agoBUG/MINOR: payload: validate minimum keyshare_len in smp_fetch_ssl_keyshare_groups
Willy Tarreau [Wed, 29 Apr 2026 07:09:33 +0000 (09:09 +0200)]
BUG/MINOR: payload: validate minimum keyshare_len in smp_fetch_ssl_keyshare_groups

The keyshare extension parsing loop reads dataPointer[readPosition+2]
and dataPointer[readPosition+3] inside the loop body, requiring at least
4 bytes to be safe. However, keyshare_len was only validated as >= 2.

With keyshare_len == 2 or 3, the first loop iteration would read past
the end of the extension data, causing an out-of-bounds read which is
harmless in practice. We also need to make sure that the read position
stops 4 bytes before the end in order to read the 4 next bytes.

This can be backported to stable versions.

13 days agoCLEANUP: tree-wide: fix comment typos all over the tree (~68)
Willy Tarreau [Tue, 28 Apr 2026 01:43:22 +0000 (03:43 +0200)]
CLEANUP: tree-wide: fix comment typos all over the tree (~68)

This covers hpack, quic, h3, map, acl, pattern, tcpchecks, clienthello.
Only comments were touched, 100% harmless, no need to backport.

13 days agoBUG/MINOR: fix various typos and spelling mistakes in user-visible messages
Willy Tarreau [Tue, 28 Apr 2026 12:02:13 +0000 (14:02 +0200)]
BUG/MINOR: fix various typos and spelling mistakes in user-visible messages

A few typos like "not unhandled" in error messages, and some spelling
mistakes mostly in cfgparse error messages were fixed. One spelling
mistake in a function name was fixed as well (ssl_sock_chose_sni_ctx
renamed to ssl_sock_choose_sni_ctx). Those which apply may be worth
being backported.

13 days agoBUG/MEDIUM: tasks: Do not loop in task_schedule() if a task is running
Olivier Houchard [Wed, 29 Apr 2026 10:24:08 +0000 (12:24 +0200)]
BUG/MEDIUM: tasks: Do not loop in task_schedule() if a task is running

Commit 7e1cc0fcdbcace75a957a69fc8a4d991f7b30fdb made it so we'd loop in
task_schedule() if the task is currently running, so that we'd be sure
that the task would not overwrite the expire field. However,
task_schedule() may be called while a lock is held, and if the running
task attempts to acquire that lock, it will lead to a deadlock.
So instead, if the task is running, just wake it up, so that we're sure
that it will reschedule itself correctly, as it should do anyway. We
already do nothing if the task is in a run queue, so it is expected that
tasks do that, and if they do not, then it is a bug.

This should fix github issue #3350
This should be backported where 7e1cc0fcdbcace75a957a69fc8a4d991f7b30fdb
has been backported, which should be up to 2.8.

13 days agoBUG/MAJOR: mux-h1: Deal with true 64-bits integer to emit chunks size
Christopher Faulet [Tue, 28 Apr 2026 16:15:15 +0000 (18:15 +0200)]
BUG/MAJOR: mux-h1: Deal with true 64-bits integer to emit chunks size

Functions emitting chunks size are using size_t integer to do so. Depending
on the code path, these functions can be called using an unsigned long long
integer (h1m->curr_len for instance). On 64-bits architectures, there is no
issue. But on the 32-bits architecture, it is a problem. size_t are 32-bits
integer so the 64-bits parameter will be casted to a 32-bits integer. For
chunk size exceeding 4GB, the wrong size will be emitted.

To fix the issue, these functions are now using true 64-bits
integer. h1s_consume_kop() was also modified accordingly.

In addition, when a size_t is compared to a 64-bits integer, an explicit
cast is used to be sure the right type is used.

This patch must be backported as far as 3.0. It must be backported after
1ef74fc7c ("BUG/MEDIUM: mux_h1: fix stack buffer overflow in
h1_append_chunk_size()").

13 days agoBUG/MEDIUM: h1: Enforce the authority validation during H1 request parsing
Christopher Faulet [Tue, 28 Apr 2026 09:20:59 +0000 (11:20 +0200)]
BUG/MEDIUM: h1: Enforce the authority validation during H1 request parsing

When a H1 request was parsed, only a light validation was performed on the
URI, mainly because there was no distinction between the different parts of
the URI. So only characters in the range [0x21, 0x7e], excluding the "#" was
allowed.

To be consistant with the H2 and H3 parser, the authority is now validated,
using http_authority_has_forbidden_char() function.

This patch should be backported as far as 2.8. For previous verions,
http_authority_has_forbidden_char() function does not exist.

13 days agoBUG/MAJOR: http: forbid comma character in authority value
Christopher Faulet [Tue, 28 Apr 2026 07:37:34 +0000 (09:37 +0200)]
BUG/MAJOR: http: forbid comma character in authority value

Strictly speaking, the comma character in authority is allowed by RFC3986.
However, it is pretty ambiguous for Host header value because comma is also
the value separator for headers supporting multiple value. It is also very
unlikely to have comma in host header value or authority. So instead of
dealing with this case with all the risks of bugs that this entails, we've
decided to forbid the comma in authority and host header value during the
parsing. Concretely, only http_authority_has_forbidden_char() was updated.

The internal API was not updated to prevent comma to be inserted when the
host header value is updated for instance. But this should be so uncommon
that it is not really a concern.

This patch should be backported as far as 2.8. For previous verions,
http_authority_has_forbidden_char() function does not exist.

13 days agoMEDIUM: http-htx: Make authority update optional when adding a header
Christopher Faulet [Fri, 24 Apr 2026 09:35:08 +0000 (11:35 +0200)]
MEDIUM: http-htx: Make authority update optional when adding a header

This patch is similar to the previous one but for header addtion. It is now
possible to skip the authority updated. An extra argument was added to
http_add_header() function for this purpose.

13 days agoMEDIUM: http-htx: Make authority update optional when replacing a header value
Christopher Faulet [Fri, 24 Apr 2026 09:15:27 +0000 (11:15 +0200)]
MEDIUM: http-htx: Make authority update optional when replacing a header value

When a header value is replaced, a test is performed to verify if the
authority must be updated or not. But there are some places where we know it
is useless. First, when the caller know the header is not the host
header. Then when the host header value is updated because the authority was
changed.

So now, an extra argument was added to http_replace_header() and
http_replace_header_value() functions to specify if the authority update
must be performed or not.

13 days agoBUG/MEDIUM: http-htx: Loop on full host value during scheme based normalization
Christopher Faulet [Tue, 28 Apr 2026 09:34:36 +0000 (11:34 +0200)]
BUG/MEDIUM: http-htx: Loop on full host value during scheme based normalization

During scheme based normalization, when the authority is normalized, the
host headers are updated accordingly. Only full host header values must be
updated. Comma-separated list are not expected here.

It is important to do so to be consistant with other places where the host
header is updated (when the request URI is changed for instance).

13 days agoBUG/MEDIUM: http-htx: Don't use data from HTX message to update authority
Christopher Faulet [Fri, 24 Apr 2026 09:06:16 +0000 (11:06 +0200)]
BUG/MEDIUM: http-htx: Don't use data from HTX message to update authority

When a host header value is updated, the authority can also be updated
accordingly. When it is performed, we must not use the new host header value
from the HTX message. Instead we must use the data passed as argument. It is
unexpected but the host header can have several comma-separated values.
Using the full header value can lead to unexpected result.

Note: having multiple comma-separated values for the host header should not
      be supported. The comma should be part of the host value. But it is
      quite ambiguous. This will be fixed in another commit.

This patch must be backported to all stable versions.

13 days agoBUG/MAJOR: http-htx: Store new host in a chunk for scheme-based normalization
Christopher Faulet [Fri, 24 Apr 2026 08:21:45 +0000 (10:21 +0200)]
BUG/MAJOR: http-htx: Store new host in a chunk for scheme-based normalization

During the scheme based normalization, The original authority value is used
to replace every host headers. It is an issue, because when the HTX message
is modified the blocks may be reorganised to find free space. For instance a
defragmentation can be performed. So the address of the authority can
change. To perform such rewrite, the new value must be stored in a temporary
buffer. It is especially important because the start-line is also updated,
so the original authority could be moved, making it invalid.

Because of this bug, it is possible to mix HTX block values. There is no
overflow but the start-line can be crushed with data from the host header
value, making it invalid for the server.

So, to fix the issue, the new host header value is now the one in the trash
chunk used to rewrite the start line. But in that case, the trash chunk must
be allocated to be sure it remains valid when replacing all host headers
values.

This patch must be backported as far as 2.6.

13 days agoCLEANUP: Reapply ha_free.cocci (2)
Tim Duesterhus [Tue, 28 Apr 2026 19:59:14 +0000 (21:59 +0200)]
CLEANUP: Reapply ha_free.cocci (2)

This reapplies ha_free.cocci across the whole src/ tree.

13 days agoCLEANUP: Reapply strcmp.cocci (3)
Tim Duesterhus [Tue, 28 Apr 2026 19:59:13 +0000 (21:59 +0200)]
CLEANUP: Reapply strcmp.cocci (3)

This reapplies strcmp.cocci across the whole src/ tree.

13 days agoCLEANUP: Reapply ist.cocci (4)
Tim Duesterhus [Tue, 28 Apr 2026 19:59:12 +0000 (21:59 +0200)]
CLEANUP: Reapply ist.cocci (4)

This reapplies ist.cocci across the whole src/ tree.

2 weeks agoBUILD: 51d: fix bool definition on dummy lib v4
William Lallemand [Tue, 28 Apr 2026 16:07:54 +0000 (18:07 +0200)]
BUILD: 51d: fix bool definition on dummy lib v4

Modern compiler breaks when defining bool, false and true.
Include <stdbool.h> instead.

$ make -j$(nproc) TARGET=linux-glibc USE_51DEGREES=1 \
   51DEGREES_VER=4 51DEGREES_SRC=addons/51degrees/dummy/v4hash/

2 weeks agoBUG/MINOR: mux_quic: free frames emitted with QMux
Amaury Denoyelle [Tue, 28 Apr 2026 09:02:23 +0000 (11:02 +0200)]
BUG/MINOR: mux_quic: free frames emitted with QMux

When using QUIC, mux instantiates quic_frame objects but does not free
them. This is performed only when acknowledgment are received.

This is not the case for QMux protocol, as the transport layer is much
simpler in this case. As such, mux is responsible to free up the frames
after emission.

This patch fixes qcc_qstrm_send_frames() by adding the necessary
qc_frm_free() calls as soon as a frame is emitted. This fixes a memory
leak. This function ensures that the freed object is removed from its
parent list, so LIST_DEL_INIT() is not necessary anymore.

No need to backport.

2 weeks agoMINOR: mux_quic: remove superfluous b_size() before b_alloc()
Amaury Denoyelle [Tue, 28 Apr 2026 08:40:05 +0000 (10:40 +0200)]
MINOR: mux_quic: remove superfluous b_size() before b_alloc()

b_alloc() does nothing if a buffer is already allocated. As such, it is
not necessary to call b_size() as a check prior to it. Removes its usage
in qcc_qstrm_recv() so that the code is similar to other b_alloc()
usages.

2 weeks agoMINOR: lb: cleanups
Maxime Henrion [Mon, 27 Apr 2026 19:29:22 +0000 (15:29 -0400)]
MINOR: lb: cleanups

Remove exports for functions that are not called directly anymore, and
make them static. This involves some reordering to avoid the need for a
forward static declaration.

Also remove the old callback fields from the lbprm struct.

2 weeks agoMEDIUM: lb: use the LB ops tables
Maxime Henrion [Mon, 27 Apr 2026 19:28:42 +0000 (15:28 -0400)]
MEDIUM: lb: use the LB ops tables

Remove manual initialization of the callbacks and use the ops field in
the lbprm struct to invoke those callbacks.

2 weeks agoMINOR: lb: infrastructure for declarative initialization
Maxime Henrion [Mon, 27 Apr 2026 18:26:18 +0000 (14:26 -0400)]
MINOR: lb: infrastructure for declarative initialization

This creates an ops structure for the various callbacks into the LB
algorithms, and defines those ops structure for each algorithm. A new
proxy_init callback is added for the initialization functions called
from proxy_finalize(). Since one of them needs to return an int in case
of an error, we change all the others to also return an int so we have a
uniform type.

No functional changes.

2 weeks agoBUG/MINOR: http_ana: use scf to report term_evts in http_wait_for_request()
Willy Tarreau [Sun, 26 Apr 2026 20:01:59 +0000 (22:01 +0200)]
BUG/MINOR: http_ana: use scf to report term_evts in http_wait_for_request()

http_wait_for_request() improperly reports term events on the scb instead
of scf, causing some request parsing failures to possibly be reported as
response errors. This was introduced in 3.2 with commit 2dc02f75b1 ("MEDIUM:
tevt/stconn/stream: Add dedicated termination events for stream location")
so it must be backported there.

2 weeks agoBUG/MEDIUM: mux_h1: fix stack buffer overflow in h1_append_chunk_size()
Willy Tarreau [Sun, 26 Apr 2026 11:51:16 +0000 (13:51 +0200)]
BUG/MEDIUM: mux_h1: fix stack buffer overflow in h1_append_chunk_size()

The char tmp[10] buffer can only hold 8 hex digits + CRLF suffix. If chksz
exceeds 4GB (0xFFFFFFFF), the do-while loop writes more than 8 hex digits,
overflowing the stack buffer by 1+ bytes. In practice the buffer is aligned
from the end and leaves a 6-byte hole before it on 64-bit systems, leaving
enough room to be harmless, and 4 on 32-bit platforms which save it from
touching lower variables. So it is safe but just by luck.

Fix by increasing tmp[] to 18 bytes, sufficient for up to 16 hex digits
(2^64 - 1) plus CRLF.

2 weeks agoMINOR: mux_quic/h3: report termination events at stream layer
Amaury Denoyelle [Mon, 27 Apr 2026 08:31:11 +0000 (10:31 +0200)]
MINOR: mux_quic/h3: report termination events at stream layer

This patch adds termination level on QUIC MUX at the stream layer.
Similarly to the previous patch, error codes should be similar to the
ones already used in H2.

Most of the values are reported via qcc_reset_stream() which have now an
extra argument for this. This is used by application protocol H3 and
hq-interop.

qmux_sctl() callback is extended to support MUX_SCTL_TEVTS to report the
current stream termination event at the upper layer.

2 weeks agoMINOR: mux_quic/h3: report termination events at connection level
Amaury Denoyelle [Mon, 20 Apr 2026 12:06:21 +0000 (14:06 +0200)]
MINOR: mux_quic/h3: report termination events at connection level

Implement termination event log in QUIC MUX layer at the connection
level. The objective is to reuse similar codes already used on H2.

Most of the error values are reported via qcc_set_error() which have now
an extra argument to specify the term event code. This is in particular
used in H3 application protocol code.

Also, qmux_ctl() now implements MUX_CTL_TEVTS to report the current
connection termination code to the upper layer. Callback qmux_sctl()
display the connection term event code on MUX_SCTL_DBG_STR.

2 weeks agoMINOR: mux_quic: display QCS sd on traces
Amaury Denoyelle [Mon, 27 Apr 2026 11:56:39 +0000 (13:56 +0200)]
MINOR: mux_quic: display QCS sd on traces

Add SD pointer and flags value when logging a QCS instance in
qmux_dump_qcs_info(). This changes output for bot htraces and
MUX_SCTL_DBG_STR.

2 weeks agoMINOR: mux_quic: return conn error code in debug string
Amaury Denoyelle [Mon, 20 Apr 2026 08:56:27 +0000 (10:56 +0200)]
MINOR: mux_quic: return conn error code in debug string

Similarly to H2, mux_quic now returns connection error code when stream
debug string is retrieved via MUX_SCTL_DBG_STR operation.

2 weeks agoCLEANUP: tree-wide: fix around 20 mistakes in comments in h2,tools,peers
Willy Tarreau [Sun, 26 Apr 2026 09:56:17 +0000 (11:56 +0200)]
CLEANUP: tree-wide: fix around 20 mistakes in comments in h2,tools,peers

This cleans up around 12 non-visible typos in h2 and mux-h2, 6 in peers,
3 in tools, and also addresses a leftover after commit 9294e8822f in 2.4
which changed the word fingerprint calculation without updating the
comment about the possible output values. No backport needed.

2 weeks agoCLEANUP: mux-h2: remove duplicate forward declaration of h2s_rxbuf_{head,tail}()
Willy Tarreau [Sun, 26 Apr 2026 09:52:41 +0000 (11:52 +0200)]
CLEANUP: mux-h2: remove duplicate forward declaration of h2s_rxbuf_{head,tail}()

These were strangely committed together with commit e4cb0ad632 ("MINOR:
mux-h2/traces: add buffer-related info to h2s and h2c").

2 weeks agoCLEANUP: tools: drop upper case check after tolower()
Willy Tarreau [Sun, 26 Apr 2026 20:47:21 +0000 (22:47 +0200)]
CLEANUP: tools: drop upper case check after tolower()

In update_word_fingerprint_with_len() we convert a character to lower
case, then it's checked against lower case, upper case and digits. Let's
just drop the upper case check which cannot happen.

2 weeks agoCLEANUP: peers: fix a few user-visible spelling mistakes
Willy Tarreau [Mon, 27 Apr 2026 12:34:59 +0000 (14:34 +0200)]
CLEANUP: peers: fix a few user-visible spelling mistakes

Just a few "leason" and "messafe" in traces. This can be backported.

2 weeks agoBUG/MINOR: peers: fix wrong flag reported twice for dump_flags
Willy Tarreau [Mon, 27 Apr 2026 12:32:36 +0000 (14:32 +0200)]
BUG/MINOR: peers: fix wrong flag reported twice for dump_flags

Flag PEERS_F_DBG_RESYNC_REMOTEASSIGN was missing and
PEERS_F_DBG_RESYNC_REMOTEABORT appeared twice instead, so the former
would not appear in flags dumps. This can be backported to 3.0.0.

2 weeks agoBUG/MINOR: peers: fix logical "and" when checking for local in PEER_APP_ST_STARTING
Willy Tarreau [Mon, 27 Apr 2026 12:30:45 +0000 (14:30 +0200)]
BUG/MINOR: peers: fix logical "and" when checking for local in PEER_APP_ST_STARTING

The expression to check both peer->local and appctx_is_back() uses a
bitwise '&' instead of a logical '&&'. Fortunately both values are
always either 0 or 1 so there is no impact. This can be backported to
all stable versions.

2 weeks agoBUG/MINOR: sample: fix NULL strm dereference in sample_conv_when
Willy Tarreau [Sun, 26 Apr 2026 21:56:00 +0000 (23:56 +0200)]
BUG/MINOR: sample: fix NULL strm dereference in sample_conv_when

Several cases in sample_conv_when (FORWARDED, TOAPPLET, PROCESSED, ACL)
access smp->strm->scb without checking if strm is NULL. The strm field
may be NULL (e.g., tcp-request connection). Let's add NULL checks to
prevent dereferencing a NULL pointer.

This should be backported to 3.1.

2 weeks agoBUG/MINOR: sample: fix memory leak in smp_resolve_args error paths
Willy Tarreau [Sun, 26 Apr 2026 21:55:03 +0000 (23:55 +0200)]
BUG/MINOR: sample: fix memory leak in smp_resolve_args error paths

Several error paths in smp_resolve_args used 'continue' which skipped
LIST_DELETE and free(cur), leaking the arg_list node. Changed all to
'break' to ensure proper cleanup on all error paths. This is harmless
since when such issues are met, the process refuses to start, so no
backport is really needed.

2 weeks agoBUG/MINOR: sample: fix memory leak in check_when_cond() when ACL is not found
Willy Tarreau [Sun, 26 Apr 2026 21:49:35 +0000 (23:49 +0200)]
BUG/MINOR: sample: fix memory leak in check_when_cond() when ACL is not found

When find_acl_by_name() and find_acl_default() both fail when parsing
converter "when(ACL,foo)", the previously allocated acl_sample struct
is leaked. Free it before returning 0. This can be backported to stable
versions.

2 weeks agoBUG/MINOR: tools: free previously allocated strings on strdup failure in backup_env()
Willy Tarreau [Sun, 26 Apr 2026 20:48:17 +0000 (22:48 +0200)]
BUG/MINOR: tools: free previously allocated strings on strdup failure in backup_env()

When strdup() fails after some entries have already been strdup'd, the function
returned -1 without freeing previously allocated strings. Added cleanup loop to
free all previously strdup'd entries and reset init_env.

This can be backported to 3.1.

2 weeks agoBUG/MINOR: tools: fix memory leak in indent_msg() on out of memory
Willy Tarreau [Sun, 26 Apr 2026 21:00:57 +0000 (23:00 +0200)]
BUG/MINOR: tools: fix memory leak in indent_msg() on out of memory

When malloc() fails in indent_msg, the function returned NULL without
freeing the original *out string as it was supposed to. The caller loses
both the original string (leaked) and gets NULL back. Fixed to free *out
and set it to NULL before returning.

2 weeks agoBUG/MINOR: tools: my_memspn/my_memcspn wrong cast causing incorrect byte reading
Willy Tarreau [Sun, 26 Apr 2026 21:00:38 +0000 (23:00 +0200)]
BUG/MINOR: tools: my_memspn/my_memcspn wrong cast causing incorrect byte reading

Both functions cast void * to int * and dereference, reading 4 bytes as an
integer instead of a single byte. This is passed to memchr() which expects a
byte value. On unaligned addresses this causes crashes on ARM/mips etc, and
search for the wrong byte on big endian platforms. Fixed to cast to
const unsigned char * and dereference a single byte. This is marked as
minor because these functions were added in 2.2 by commit 5eb96cbcbc
("MINOR: standard: Add my_memspn and my_memcspn") and have not been used
since then.

2 weeks agoCLEANUP: tree-wide: address various spelling mistakes in comments from -dev7
Willy Tarreau [Mon, 27 Apr 2026 07:34:03 +0000 (09:34 +0200)]
CLEANUP: tree-wide: address various spelling mistakes in comments from -dev7

These ones were found in recent patches merged since -dev7. There is no
user-visible change so no backport is needed.

2 weeks agoBUG/MINOR: tree-wide: fix a few user-visible spelling mistakes from dev7
Willy Tarreau [Mon, 27 Apr 2026 07:39:49 +0000 (09:39 +0200)]
BUG/MINOR: tree-wide: fix a few user-visible spelling mistakes from dev7

These spelling mistakes in documentation, traces or error messages
were introduced after -dev7. Some might possibly deserve being
backported.

2 weeks agoBUG/MINOR: ssl: fix double-free on failed realloc in ssl_sock.c
Willy Tarreau [Mon, 27 Apr 2026 06:38:31 +0000 (08:38 +0200)]
BUG/MINOR: ssl: fix double-free on failed realloc in ssl_sock.c

Recent commit 90bfbea7c0 ("BUG/MINOR: ssl: fix memory leaks on realloc
failure in ssl_sock.c") accidentally turned a memory leak in case of
allocation failure into a double-free: the original pointer must no
longer be released. In addition, the allocated_size has to be reset
in case of failure. This needs to be backported to 3.3 like previous
commit.

2 weeks agoBUILD: ot: emitted deprecation warning at build time
Miroslav Zagorac [Mon, 27 Apr 2026 06:15:33 +0000 (08:15 +0200)]
BUILD: ot: emitted deprecation warning at build time

Warn at Makefile parse time that the opentracing filter was deprecated
in haproxy 3.3 and will be removed in 3.5, complementing the runtime
warning emitted at filter init.

2 weeks agoMEDIUM: ot: emitted deprecation warning at filter init
Miroslav Zagorac [Mon, 27 Apr 2026 06:08:39 +0000 (08:08 +0200)]
MEDIUM: ot: emitted deprecation warning at filter init

The opentracing filter was deprecated in haproxy 3.3 and will be removed
in 3.5.  A warning is now issued during filter initialization, unless the
global 'expose-deprecated-directives' directive is set.  The notice is
emitted only once regardless of the number of filter instances.

2 weeks agoDOC: config: Fix typo in tune.bufsize.large description
Christopher Faulet [Mon, 27 Apr 2026 05:34:35 +0000 (07:34 +0200)]
DOC: config: Fix typo in tune.bufsize.large description

"butes" was used instead of "bytes".

Should fix the issue #3322.

2 weeks agoDOC: config: Fix log-format example with last rule expressions
Christopher Faulet [Mon, 27 Apr 2026 05:32:20 +0000 (07:32 +0200)]
DOC: config: Fix log-format example with last rule expressions

%[] were missing.

2 weeks agoBUG/MINOR: ssl: fix memory leak on realloc failure in acme.ips
BiancaDogareci [Sat, 25 Apr 2026 12:00:37 +0000 (15:00 +0300)]
BUG/MINOR: ssl: fix memory leak on realloc failure in acme.ips

Fix a realloc() bug in ckchs_dup() when copying the acme.ips array,
where overwriting the original pointer with NULL on allocation failure
loses reference to the original memory block.

Use my_realloc2() which safely handles the failure.

No backport needed.

2 weeks agoBUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_sock.c
Ilia Shipitsin [Mon, 13 Apr 2026 16:14:51 +0000 (18:14 +0200)]
BUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_sock.c

Replace bare realloc() calls with my_realloc2(), which frees the original
pointer on allocation failure, preventing a memory leak when the pointer
is subsequently overwritten with NULL.

Must be backported to 3.3.

2 weeks agoBUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_ckch.c
Ilia Shipitsin [Mon, 13 Apr 2026 16:14:50 +0000 (18:14 +0200)]
BUG/MINOR: ssl: fix memory leaks on realloc failure in ssl_ckch.c

Replace bare realloc() calls with my_realloc2(), which frees the original
pointer on allocation failure, preventing a memory leak when the pointer
is subsequently overwritten with NULL.

Must be backported to 3.2.

2 weeks agoBUG/MEDIUM: stats: fix crash on 'dump stats-file'
Amaury Denoyelle [Fri, 24 Apr 2026 13:58:42 +0000 (15:58 +0200)]
BUG/MEDIUM: stats: fix crash on 'dump stats-file'

A crash occurs immediately when stats-file dump is requested by the
command-line. The issue is caused by the introduction of watchers when
iterating over the proxies list, which is now required with dynamic
backends.

  commit 20376c54e2166a0882b71b26326360786f79ebdb
  MINOR: stats: protect proxy iteration via watcher

The above patch initializes the new proxy watcher for stats dump and
HTML. However, this was forgotten for stats-file command context. Fix
this by adding the missing watcher_init() in cli_parse_show_stat().

No need to backport.

2 weeks agoMINOR: sample: converter for frontend existence check
Pierre Cheynier [Fri, 17 Apr 2026 07:37:14 +0000 (07:37 +0000)]
MINOR: sample: converter for frontend existence check

Introduced a new sample converter using keyword "fe_exists" checking if
a frontend with a given name exists.

2 weeks agoBUG/MINOR: tcpcheck: Allow connection reuse without prior traffic
Daniel Lenar [Sat, 18 Apr 2026 02:29:45 +0000 (21:29 -0500)]
BUG/MINOR: tcpcheck: Allow connection reuse without prior traffic

New connections created by tcpcheck for are marked as private, making
them ineligible for insertion into the server-side connection pool, even
when check-reuse-pool is activated. Thus, connection reuse for health
checks would only work when the pool had already been populated by
regular (non-check) traffic.

Change this behavior so that a new check connection is not flagged as
private anymore when check-reuse-pool is requested. As a result, on
detach, instead of being freed, the connection will be inserted in the
idle pool and will be eligible for reuse, both for regular traffic and
checks.

This change can be useful to ensure that a server idle pool is never
completely empty when check-reuse-pool is active. Additionnally, it is
also necessary to ensure that check reuse is really effective when
connection parameters are different between checks and regular traffic,
resulting in a different reuse hash.

The previous behavior could be considered as a bug to a certain extents.
The current patch should be harmless for default configuration, but it
can be a significant improvment for users who want to perform reuse for
checks. Thus, it should be backported up to 3.2.

2 weeks agoMINOR: mux_quic: handle incomplete QMux record read
Amaury Denoyelle [Thu, 23 Apr 2026 13:38:06 +0000 (15:38 +0200)]
MINOR: mux_quic: handle incomplete QMux record read

QMux implements a record layer which is used to encapsulate QUIC frames.

This patch implements reception of an incomplete record in
qcc_qstrm_recv(). BUG_ON() failures are removed and now reading will
continue until the whole record is received or a fatal error occurs.

Several adjustments were made in the logic for read operation.
Previously, read syscall was only performed if either data buffer was
empty or current record was incomplete. An extra condition is added to
perform read if there is data in the buffer but not enough to decode a
record header. Another change is that buffer realign is also performed
in this latter case and if buffer wrapping position has been reached.

2 weeks agoMINOR: mux_quic: handle conn errors on QMux without crash
Amaury Denoyelle [Thu, 23 Apr 2026 13:37:34 +0000 (15:37 +0200)]
MINOR: mux_quic: handle conn errors on QMux without crash

Remove BUG_ON() related to connection errors when invoking XPRT
snd_buf/rcv_buf in QMux operations. Such errors are now converted in
QC_CF_ERR_CONN flag, which will disable any I/O operations and close the
connection as soon as possible.

Note that this error management is pretty crude. In particular, it could
lead to truncated data when dealing with unidirectional connection
closure from the remote peer. However, it is considered sufficient for
now to continue interop testing without being disturbed by BUG_ON()
assertion crashes.

2 weeks agoMINOR: mux_quic: receive MAX_STREAMS_BIDI frames in QMux
Amaury Denoyelle [Thu, 23 Apr 2026 13:36:38 +0000 (15:36 +0200)]
MINOR: mux_quic: receive MAX_STREAMS_BIDI frames in QMux

Support reception via QMux of flow control MAX-STREAMS frame for
bidirectional streams. This is similar to the QUIC with shared
qcc_recv_max_streams() function.

2 weeks agoMINOR: mux_quic/xprt_qstrm: simplify Rx buffer transfer
Amaury Denoyelle [Thu, 23 Apr 2026 13:36:08 +0000 (15:36 +0200)]
MINOR: mux_quic/xprt_qstrm: simplify Rx buffer transfer

When xprt_qstrm layer is completed, MUX layer is started. Rx buffer from
the XPRT layer is transferred to the MUX so that it can handle any extra
data following the transport parameters first frame.

Since previous commit, QCC Rx buffer is dynamically allocated only when
needed. However, qmux_init() must still allocate it when there is data
to be transferred from the XPRT layer. As a result, code has been over
extended to continue to support this case.

This patch simplifies xprt_qstrm API for the Rx buffer transfer. Buffer
content and remaining record length can now be retrieved via the single
function xprt_qstrm_xfer_rxbuf(). If the buffer is empty, nothing is
performed and XPRT layer will release it. If not empty, MUX will take
ownership of the buffer from the XPRT layer.

2 weeks agoMINOR: mux_quic: use dynamic conn buffers for QMux
Amaury Denoyelle [Thu, 23 Apr 2026 12:41:34 +0000 (14:41 +0200)]
MINOR: mux_quic: use dynamic conn buffers for QMux

Allocate and release as needed the QCC buffers used for QMux protocol.
This should reduce the memory consumption of QMux. This is performed
both for send and receive buffers. Along with this, always free these
buffers in qcc_release() to prevent a memory leak.

2 weeks agoMINOR: mux_quic: use dynamic Tx streams buffers for QMux
Amaury Denoyelle [Thu, 23 Apr 2026 12:51:09 +0000 (14:51 +0200)]
MINOR: mux_quic: use dynamic Tx streams buffers for QMux

Improve QMux memory usage at the QCS level in accordance with the
haproxy model. The tx buffer is now allocated only when used and
released as soon as it is empty.

This change requires to extend qcc_get_stream_txbuf() for QMux. Code
part related to qc_stream_desc is protected via conn_is_quic(). A
dedicated QMux bloc is added. Similarly to QUIC, a small buf can be
allocated first.

This also requires to adapt qcc_realloc_stream_txbuf() in a similar
fashion.

2 weeks agoMINOR: mux_quic: refactor QMux send frames function
Amaury Denoyelle [Thu, 23 Apr 2026 12:37:55 +0000 (14:37 +0200)]
MINOR: mux_quic: refactor QMux send frames function

Clean up qcc_qstrm_send_frames(). The main change is that now return
value is clearly specified at the end of the function, depending if
everything was sent or not.

2 weeks agoMINOR: xprt_qstrm: implement close callback
Amaury Denoyelle [Thu, 23 Apr 2026 09:42:25 +0000 (11:42 +0200)]
MINOR: xprt_qstrm: implement close callback

Implement close callback for xprt_qstrm layer. This is called when a
connection is prematurely closed following a connect failure. Its
purpose is to clean up all xprt resources.

A special care is required for the frontend side. Indeed,
xprt_qstrm_io_cb() can call close callback via conn_create_mux() on the
latter failure. The tasklet should then immediately be stopped as the
whole xprt layer has been freed as well.

2 weeks agoMINOR: connection: document conn_create_mux()
Amaury Denoyelle [Thu, 23 Apr 2026 09:40:23 +0000 (11:40 +0200)]
MINOR: connection: document conn_create_mux()

Function conn_create_mux() has different behavior for frontend and
backend connections. In particular, on FE side, there is a risk that the
connection is freed.

Write a comment to explain these differences clearly.

2 weeks agoMINOR: xprt_qstrm: remove unused subs
Amaury Denoyelle [Thu, 23 Apr 2026 12:15:32 +0000 (14:15 +0200)]
MINOR: xprt_qstrm: remove unused subs

Currently, xprt_qstrm does not implement subscribe mechanism. As such,
it is better for now to remove unused member <subs> for clarity.

2 weeks agoBUG/MINOR: mux_quic: do not release conn on qcc_recv() for QMux
Amaury Denoyelle [Thu, 23 Apr 2026 13:32:58 +0000 (15:32 +0200)]
BUG/MINOR: mux_quic: do not release conn on qcc_recv() for QMux

Recently, an extra check has been added so that a dead connection is
immediately release on at the end of qcc_recv() operation. This is
useful when a GOAWAY frame is received from a server, so that the
backend connection is released if idle.

This step is in fact only necessary for QUIC, as qcc_recv() is called
directly from the lower transport layer. It causes issues with QMux as
in this case qcc_recv() is called via qcc_io_recv(). A crash in this
context will occur as qcc_recv() does not indicate that a release has
been performed.

To fix this, simply disable the extra check at the end of qcc_recv() for
QMux. This is fine as in this case receive operation is always followed
by qcc_io_process() which is able to release the connection in a safe
way.

No need to backport.

2 weeks agoBUG/MINOR: xprt_qstrm: prevent crash if conn release on MUX wake
Amaury Denoyelle [Thu, 23 Apr 2026 15:32:44 +0000 (17:32 +0200)]
BUG/MINOR: xprt_qstrm: prevent crash if conn release on MUX wake

When QMux XPRT has successfully been able to process to transport
parameters exchange, the MUX is initialized and immediately woken up to
start transfers. However, if the connection is in an unusable state, the
latter operation will instead release the connection and all of its
network stack.

A crash would occur in case of release when finalizing the XPRT tasklet
completion. To fix this, first free every XPRT resources. MUX wake is
now conducted in a safe way as the last operation before the tasklet is
completely released.

No need to backport.

2 weeks agoBUG/MINOR: xprt_qstrm: ensure all local TPs are allocated
Amaury Denoyelle [Thu, 23 Apr 2026 15:51:03 +0000 (17:51 +0200)]
BUG/MINOR: xprt_qstrm: ensure all local TPs are allocated

Complete initialization of xprt_qstrm layer by setting local parameters
to zero. This should prevent to emit random values to the peer.

No backport needed.

2 weeks agoBUG/MINOR: mux_quic: prevent crash on qc_frm_free() with QMux
Amaury Denoyelle [Fri, 24 Apr 2026 07:30:28 +0000 (09:30 +0200)]
BUG/MINOR: mux_quic: prevent crash on qc_frm_free() with QMux

qc_frm_free() is a helper used to clean up a QUIC frame object. It is
used by MUX layer both for QUIC and QMux protocols.

This function takes a pointer to the underlying quic_conn, used only for
trace purpose. This patch fixes its usage for QMux to ensure that in
this case a NULL value is used.

No need to backport.

2 weeks agoBUG/MEDIUM: mux-h1: Force close mode for bodyless message announcing a C-L
Christopher Faulet [Wed, 22 Apr 2026 14:55:00 +0000 (16:55 +0200)]
BUG/MEDIUM: mux-h1: Force close mode for bodyless message announcing a C-L

When dealing with EOH block, we must be sure to force the close mode for
message with no payload but annoncing a non-null content-length.

It is mainly an issue on the server side but it could be encountered on
client side too. Without this fix, a request can be switched to the DONE
state while the server is still expecting the payload. In an ideal world,
this case should not happen. But in conjunction with other bugs, it may lead
to a desynchro between haproxy and the server.

Now, when a non-null content-length is announced but we know we reached the
end of the message, we force the close mode. The only exception is for
bodyless responses (204s, 304s and responses to head requests).

Thanks to Martino Spagnuolo (r3verii) for his detailed report on this issue.

This patch must be backported to all stable version.

2 weeks agoBUG/MAJOR: mux-h2: detect incomplete transfers on HEADERS frames as well
Willy Tarreau [Wed, 22 Apr 2026 12:54:20 +0000 (14:54 +0200)]
BUG/MAJOR: mux-h2: detect incomplete transfers on HEADERS frames as well

Checks are already made on H2 to detect inconsistencies between
advertised content-length and transferred data (excess of data or
premature END_STREAM flag on DATA frame). However, as found by
Martino Spagnuolo (r3verii), a subtle case remains: if the END_STREAM
appears on the HEADERS frame (i.e. a regular request for example),
then the check is not made. In this case it is possible to advertise
more contents than will really be transferred. If the other side uses
HTTP/1.1, and the server responds before the end of the transfer,
this means that the number of advertised bytes that will never be
transferred and that the server will drain will be taken from the
next request, effectively hiding a part of the header.

In practice this can be used to force subsequent requests to fail, or
when running with "http-reuse never" or when running with a totally
idle server, to perform a request smuggling by constructing specially
crafted request pairs where the first one is used to trigger an early
response and hide parts of or all headers of the second one, to
instead use a second embedded one that was not subject to analysis.

The risk remains moderate given the low prevalence of "http-reuse never"
in production environments, and of idle servers.

The fix consists in detecting if advertised content-length remains when
processing an END_STREAM flag on a HEADERS frame. It also does it for
trailers, which turn out to be another way to abuse the bug. However it
takes great care not to break bodyless responses (204, 304 and responses
to HEAD requests) that may present a content-length that doesn't reflect
the presence of a body in the response.

A temporary alternative to the fix is to disable HTTP/2 by specifying
"alpn http/1.1" on "bind" lines, and adding "option disable-h2-upgrade"
in HTTP frontends.

This must be backported to all stable versions.

2 weeks agoBUG/MINOR: server: fix a possible leak of an error message in dynamic servers
Willy Tarreau [Thu, 23 Apr 2026 13:10:01 +0000 (15:10 +0200)]
BUG/MINOR: server: fix a possible leak of an error message in dynamic servers

In 3.4-dev6, commit de5fc2f515 ("BUG/MINOR: server: set auto SNI for
dynamic servers") allowed to properly set the SNI, and return an error
message. However the error message is leaked after being printed on the
CLI.

This should be backported to 3.3.

2 weeks agoRevert "BUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()"
Willy Tarreau [Thu, 23 Apr 2026 12:37:33 +0000 (14:37 +0200)]
Revert "BUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()"

This reverts commit 3c63298acdb298ed2cf18cde0b47c361ed7fdd8c.

Christopher and I had the same idea at the same moment, no need for
two fixes!

2 weeks agoBUG/MINOR: debug: properly mark the entire libs archive read-only
Willy Tarreau [Thu, 23 Apr 2026 11:52:33 +0000 (13:52 +0200)]
BUG/MINOR: debug: properly mark the entire libs archive read-only

In 3.4-dev7, commit e1738b665d ("MINOR: debug: read all libs in memory
when set-dumpable=libs") reads dependencies into memory to store them as
a tar archive for later debugging. There was an attempt to mark the whole
archive read-only, except that the size passed in argument to mprotect()
is wrong: lib_size is only assigned after the operation and is still zero
at the moment this is done. new_size ought to be used instead.

This needs to be backported wherever the commit above is backported, at
least 3.2.

2 weeks agoBUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()
Willy Tarreau [Thu, 23 Apr 2026 09:40:03 +0000 (11:40 +0200)]
BUG/MINOR: stream: add the newly added SF_TXN_* flags to strm_show_flags()

3 new enum values and a mask were added in latest -dev with commit
24e05fe33a ("MINOR: stream: Use a pcli transaction to replace pcli_*
members"), unfortunately the entries needed by the "flags" command were
forgotten.

No backport is needed.

2 weeks agoDOC: config: fix typo introduce in max-threads-per-group documentation
Willy Tarreau [Thu, 23 Apr 2026 09:32:52 +0000 (11:32 +0200)]
DOC: config: fix typo introduce in max-threads-per-group documentation

Since commit 0af603f46f ("MEDIUM: threads: change the default
max-threads-per-group value to 16"), it was written "Tha minimum" instead
of "The minimum". No backport needed, this is only in latest -dev.

2 weeks agoBUG/MINOR: servers: fix last_sess date calculation
Willy Tarreau [Thu, 23 Apr 2026 09:24:22 +0000 (11:24 +0200)]
BUG/MINOR: servers: fix last_sess date calculation

In 3.4-dev8, commit e264523112 ("MINOR: servers: Don't update last_sess
if it did not change") adjusted the last_sess date to avoid writing to
the same cache line all the time, however a typo makes it pick the wrong
second because it uses now_ms instead of now_ns (so the date would roughly
change every 12 days).

No backport needed.

2 weeks agoBUG/MINOR: compression: properly disable request when setting response
Willy Tarreau [Thu, 23 Apr 2026 09:00:11 +0000 (11:00 +0200)]
BUG/MINOR: compression: properly disable request when setting response

In 2.8, commit ead43fe4f2 ("MEDIUM: compression: Make it so we can
compress requests as well.") added the ability to independently enable
compression on request and/or response. However there's a bug in the
"compression direction response" case, which preserves only the request
flag and adds the response direction instead of clearing the request
flag, so this directive would clear offload and make it impossible to
disable request if it was already previously enabled.

This can be backported to stable releases as far as 2.8.

2 weeks agoREGTESTS: Never reuse server connection in server/cli_delete_dynamic_server.vtc
Christopher Faulet [Thu, 23 Apr 2026 08:55:00 +0000 (10:55 +0200)]
REGTESTS: Never reuse server connection in server/cli_delete_dynamic_server.vtc

A "Connection: close" header is added to responses to avoid any connection
reuse. This should avoid errors on the client side.

2 weeks agoREGTESTS: Never reuse server connection in jwt/jws_verify.vtc
Christopher Faulet [Thu, 23 Apr 2026 08:52:53 +0000 (10:52 +0200)]
REGTESTS: Never reuse server connection in jwt/jws_verify.vtc

A "Connection: close" header is added to responses to avoid any connection
reuse. This should avoid errors on the client side.

2 weeks agoBUG/MINOR: stream: Add SF_TXN_HTTP/SF_TXN_PCLI flags in strm_show_flags()
Christopher Faulet [Thu, 23 Apr 2026 08:43:36 +0000 (10:43 +0200)]
BUG/MINOR: stream: Add SF_TXN_HTTP/SF_TXN_PCLI flags in strm_show_flags()

These flags were missing in strm_show_flags(). So let's add them.

No backport needed.

2 weeks agoCLEANUP: cli: Fix typos in comments
Christopher Faulet [Thu, 23 Apr 2026 08:42:31 +0000 (10:42 +0200)]
CLEANUP: cli: Fix typos in comments

Some minor typos in comments were fixed.

2 weeks agoDOC: config: Fix a typo for "external-check" directive
Christopher Faulet [Thu, 23 Apr 2026 08:06:10 +0000 (10:06 +0200)]
DOC: config: Fix a typo for "external-check" directive

Fix duplicated "to the" in the "external-check" directive description.

2 weeks agoCLEANUP: proxy: Fix typos in comments
Christopher Faulet [Thu, 23 Apr 2026 08:05:19 +0000 (10:05 +0200)]
CLEANUP: proxy: Fix typos in comments

Some minor typos in comments were fixed.

2 weeks agoBUG/MEDIUM: tcpcheck: Release temporary small chunk when retrying on http-check
Christopher Faulet [Thu, 23 Apr 2026 07:56:06 +0000 (09:56 +0200)]
BUG/MEDIUM: tcpcheck: Release temporary small chunk when retrying on http-check

When a http request is sent during an http healthcheck, if an error is
triggered while the output buffer is a small buffer, another attempt is made
with a larger one. When this happens, the temporary chunk used to format
headers must be released.

No backport needed.

2 weeks agoCLEANUP: http-client: Fix typos in comments
Christopher Faulet [Thu, 23 Apr 2026 07:49:29 +0000 (09:49 +0200)]
CLEANUP: http-client: Fix typos in comments

Some minor typos in comments were fixed.

2 weeks agoCLEANUP: chunk: Fix a typo in a comment
Christopher Faulet [Thu, 23 Apr 2026 07:46:39 +0000 (09:46 +0200)]
CLEANUP: chunk: Fix a typo in a comment

A minor typo in a comment was fixed.

2 weeks agoCLEANUP: htx: Fix typos in comments
Christopher Faulet [Thu, 23 Apr 2026 07:42:17 +0000 (09:42 +0200)]
CLEANUP: htx: Fix typos in comments

Some minor typos in comments were fixed.

2 weeks agoCLEANUP: config: Fix warning about invalid small buffer size
Christopher Faulet [Thu, 23 Apr 2026 07:38:24 +0000 (09:38 +0200)]
CLEANUP: config: Fix warning about invalid small buffer size

"than" must be used instead of "to".

2 weeks agoCLEANUP: haterm: Fix typos in comments
Christopher Faulet [Thu, 23 Apr 2026 07:30:45 +0000 (09:30 +0200)]
CLEANUP: haterm: Fix typos in comments

Some minor typos in comments were fixed.

2 weeks agoBUG/MINOR: tcpcheck: Fix a leak on deinit by releasing ruleset's conf.file
Christopher Faulet [Thu, 23 Apr 2026 07:20:43 +0000 (09:20 +0200)]
BUG/MINOR: tcpcheck: Fix a leak on deinit by releasing ruleset's conf.file

Now healthcheck sections are supported, a ruleset can reference a
configuration file that must be freed on deinit. So let's do so.

No backport needed.

2 weeks agoBUG/MINOR: tcpcheck: Don't release ruleset when parsing 'spop-check' ruleset
Christopher Faulet [Thu, 23 Apr 2026 07:03:55 +0000 (09:03 +0200)]
BUG/MINOR: tcpcheck: Don't release ruleset when parsing 'spop-check' ruleset

Ruleset are stored in a global tree, released on deinit staged. All errors
are fatal and abort the configuration parsing. So the current ruleset must
not be released here.

2 weeks agoMINOR: tcpcheck: Rely on free_tcpcheck_ruleset() to deinit tcpchecks
Christopher Faulet [Thu, 23 Apr 2026 06:49:28 +0000 (08:49 +0200)]
MINOR: tcpcheck: Rely on free_tcpcheck_ruleset() to deinit tcpchecks

There is already a function to release a tcpcheck ruleset. So let's use it
on deinit stage.

2 weeks agoCLEANUP: tcpcheck: Fix some typos in comments
Christopher Faulet [Thu, 23 Apr 2026 06:39:45 +0000 (08:39 +0200)]
CLEANUP: tcpcheck: Fix some typos in comments

Some minor typos in comments were fixed.

2 weeks agoBUG/MINOR: http-act: fix a typo in a "del-heeaders-bin" error message
Christopher Faulet [Thu, 23 Apr 2026 06:28:44 +0000 (08:28 +0200)]
BUG/MINOR: http-act: fix a typo in a "del-heeaders-bin" error message

"with is" was replaced by "with" and the action name was not properly
reported (a 's' was missing).

No backport nedded.