]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
8 days agoBUG/MINOR: tcpcheck: Use tcpcheck context for expressions parsing
Christopher Faulet [Thu, 26 Mar 2026 21:57:58 +0000 (22:57 +0100)] 
BUG/MINOR: tcpcheck: Use tcpcheck context for expressions parsing

When log-format stirngs were parsed in context of a tcpcheck, ARGC_SRV
context was used instead of ARGC_TCK. This context is used to report
accurrate errors.

This patch could be backported to all stable versions.

8 days agoMINOR: tcpcheck: Use tcpcheck flags to know a healthcheck uses SSL connections
Christopher Faulet [Thu, 26 Mar 2026 21:54:12 +0000 (22:54 +0100)] 
MINOR: tcpcheck: Use tcpcheck flags to know a healthcheck uses SSL connections

The proxy flag PR_O_TCPCHK_SSL is replaced by a flag on the tcpcheck
itself. When TCPCHK_FL_USE_SSL flag is set, it means the healthcheck will
use an SSL connection and the SSL xprt must be prepared for the server.

8 days agoBUG/MINOR: tcpcheck: Don't enable http_needed when parsing HTTP samples
Christopher Faulet [Thu, 26 Mar 2026 12:42:28 +0000 (13:42 +0100)] 
BUG/MINOR: tcpcheck: Don't enable http_needed when parsing HTTP samples

In tcpchecks context, when HTTP sample expressions are parsed, there is no
reason to set the proxy's http_needed value to 1. This value is only used
for streams to allocate an HTTP txn.

This patch could be backported to all stable versions.

8 days agoMINOR: tcpcheck: Deal with disable-on-404 and send-state in the tcp-check itself
Christopher Faulet [Thu, 26 Mar 2026 08:14:58 +0000 (09:14 +0100)] 
MINOR: tcpcheck: Deal with disable-on-404 and send-state in the tcp-check itself

disable-on-404 and send-state options, configured on an HTTP healtcheck,
were handled as proxy options. Now, these options are handled in the
tcp-check itself. So the corresponding PR_O and PR_02 flags are removed.

8 days agoMEDIUM: tcpcheck: Refactor how tcp-check rulesets are stored
Christopher Faulet [Thu, 26 Mar 2026 07:56:29 +0000 (08:56 +0100)] 
MEDIUM: tcpcheck: Refactor how tcp-check rulesets are stored

The tcpcheck_rules structure is replaced by the tcpcheck structure. The main
difference is that the ruleset is now referenced in the tcpcheck structure,
instead of the rules list. The flags about the ruleset type are moved into
the ruleset structure and flags to track unused rules remains on the
tcpcheck structure. So it should be easier to track unused rulesets. But it
should be possible to configure a set of tcpcheck rules outside of the proxy
scope.

The main idea of these changes is to prepare the parsing of a new
healthcheck section. So this patch is quite huge, but it is mainly about
renaming some fields.

8 days agoBUG/MINOR: tcpcheck: Remove unexpected flag on tcpcheck rules for httchck option
Christopher Faulet [Tue, 24 Mar 2026 13:55:01 +0000 (14:55 +0100)] 
BUG/MINOR: tcpcheck: Remove unexpected flag on tcpcheck rules for httchck option

When parsing httpchck option, a wrong flag (TCPCHK_SND_HTTP_FROM_OPT) was
set on the rules, while it is in fact a flag for a send rule. Let's remove
it. There is no issue here because there is no corresponding flag for
tcpcheck rules.

This patch must be backported to all stable versions.

8 days agoMEDIUM: http_act: Rework *-headers-bin actions
Christopher Faulet [Wed, 1 Apr 2026 12:02:30 +0000 (14:02 +0200)] 
MEDIUM: http_act: Rework *-headers-bin actions

These actions were added recently and it appeared the way binary headers
were retrieved could be simplified.

First, there is no reason to retrieve a base64 encoded string. It is
possible to rely on the binary string directly. "b64dec" converter can be
used to perform a base64 decoding if necessary.

Then, using a log-format string is quite overkill and probably
conterintuitive. Most of time, the headers will be retrieved from a
variable. So a sample expression is easier to use. Thanks to the previous
patch, it is quite easy to achieve.

This patch relies on the commit "MINOR: action: Add a sample expression
field in arguments used by HTTP actions". The documentation was updated
accordingly.

8 days agoMINOR: action: Add a sample expression field in arguments used by HTTP actions
Christopher Faulet [Wed, 1 Apr 2026 12:00:24 +0000 (14:00 +0200)] 
MINOR: action: Add a sample expression field in arguments used by HTTP actions

This could be useful for some HTTP actions. It was possible to rely on a
log-format string. It is now possible to also use a sample expression.

8 days agoBUG/MINOR: http_act: Make set/add-headers-bin compatible with ACL conditions
Christopher Faulet [Wed, 1 Apr 2026 09:17:47 +0000 (11:17 +0200)] 
BUG/MINOR: http_act: Make set/add-headers-bin compatible with ACL conditions

An error is erroneously triggered if a if/unless statement is found after
set-headers-bin and add-headers-bin actions. To make it works, during
parsing of these actions, we should leave when an unknown argument is found
to let the rule parser the opportunity to parse an if/unless statement.

No backport needed.

8 days agoDOC: configuration: update tune.ssl.keylog URL to IETF draft
William Lallemand [Wed, 1 Apr 2026 14:21:27 +0000 (16:21 +0200)] 
DOC: configuration: update tune.ssl.keylog URL to IETF draft

Replace the Mozilla NSS key log format link with the IETF draft:
https://tlswg.org/sslkeylogfile/draft-ietf-tls-keylogfile.html

8 days agoMINOR: ssl/log: add keylog format variables and env vars
William Lallemand [Wed, 1 Apr 2026 08:56:24 +0000 (10:56 +0200)] 
MINOR: ssl/log: add keylog format variables and env vars

Add keylog_format_fc and keylog_format_bc global variables containing
the SSLKEYLOGFILE log-format strings for the frontend (client-facing)
and backend (server-facing) TLS connections respectively. These produce
output compatible with the SSLKEYLOGFILE format described at:
https://tlswg.org/sslkeylogfile/draft-ietf-tls-keylogfile.html

Both formats are also exported as environment variables at startup:
  HAPROXY_KEYLOG_FC_LOG_FMT
  HAPROXY_KEYLOG_BC_LOG_FMT

These variables contains \n so they might not be compatible with syslog
servers, using them with stderr or a sink might be required.

These can be referenced directly in "log-format" directives to produce
SSLKEYLOGFILE-compatible output, usable by network analyzers such as
Wireshark to decrypt captured TLS traffic.

8 days agoMINOR: servers: Don't update last_sess if it did not change
Olivier Houchard [Wed, 1 Apr 2026 13:08:26 +0000 (15:08 +0200)] 
MINOR: servers: Don't update last_sess if it did not change

Check that last_sess actually changed before attempting to set it, as it
should only change once every second, that will avoid a lot of atomic
writes on a busy cache line.

8 days agoMINOR: backends: Don't update last_sess if it did not change
Olivier Houchard [Wed, 1 Apr 2026 13:01:09 +0000 (15:01 +0200)] 
MINOR: backends: Don't update last_sess if it did not change

Check that last_sess actually changed before attempting to set it, as it
should only change once every second, that will avoid a lot of atomic
writes on a busy cache line.

8 days agoMEDIUM: stats: Hide the version by default and add stats-showversion
Olivier Houchard [Wed, 1 Apr 2026 12:25:05 +0000 (14:25 +0200)] 
MEDIUM: stats: Hide the version by default and add stats-showversion

Reverse the default, to hide the version from stats by default, and add
a new keyword, "stats show-version", to enable them, as we don't want to
disclose the version by default, especially on public websites.

9 days agoBUG/MINOR: http_act: Properly handle decoding errors in *-headers-bin actions
Christopher Faulet [Tue, 31 Mar 2026 20:24:32 +0000 (22:24 +0200)] 
BUG/MINOR: http_act: Properly handle decoding errors in *-headers-bin actions

When binary headers are decoded, return value of decode_varint() function is
not properly handled. On error, it can return -1. However, the result is
inconditionnaly added to an unsigned offset.

Now, a temporary variable is used to be abl to test decode_varint() return
value. It is added to the offset on success only.

No backport needed.

9 days agoBUG/MEDIUM: mux-h1: Don't set MSG_MORE on bodyless responses forwarded to client
Cody Ohlsen [Sat, 28 Mar 2026 00:05:20 +0000 (17:05 -0700)] 
BUG/MEDIUM: mux-h1: Don't set MSG_MORE on bodyless responses forwarded to client

When h1_snd_buf() inherits the CO_SFL_MSG_MORE flag from the upper layer, it
unconditionally propagates it to H1C_F_CO_MSG_MORE, which eventually sets
MSG_MORE on the sendmsg() call. For bodyless responses (HEAD, 204, 304), this
causes the kernel to cork the TCP connection for ~200ms waiting for body data
that will never be sent.

With an H1 frontend and H2 backend, this adds ~200ms of latency to many or
all bodyless responses. The 200ms corresponds to the kernel's tcp_cork_time
default. H1 backends are less affected because h1_postparse_res_hdrs() sets
HTX_FL_EOM during header parsing for bodyless responses, but H2 backends
frequently deliver the end-of-stream signal in a separate scheduling round,
leaving htx_expect_more() returning TRUE when headers are first forwarded.

The fix guards H1C_F_CO_MSG_MORE so it is only set when the connection is a
backend (H1C_F_IS_BACK) or the response is not bodyless
(!H1S_F_BODYLESS_RESP). This ensures bodyless responses on the front
connection are sent immediately without corking.

This should be backported to all stable branches.

Co-developed-by: Billy Campoli <bcampoli@meta.com>
Co-developed-by: Chandan Avdhut <cavdhut@meta.com>
Co-developed-by: Neel Raja <neelraja@meta.com
9 days agoMEDIUM: Add set-headers-bin, add-headers-bin and del-headers-bin actions
Nenad Merdanovic [Mon, 30 Mar 2026 21:58:21 +0000 (23:58 +0200)] 
MEDIUM: Add set-headers-bin, add-headers-bin and del-headers-bin actions

These actions allow setting, adding and deleting multiple headers from
the same action, without having to know the header names during parsing.
This is useful when doing things with SPOE.

9 days agoDOC: configuration: mention QUIC server support
Amaury Denoyelle [Tue, 31 Mar 2026 15:39:10 +0000 (17:39 +0200)] 
DOC: configuration: mention QUIC server support

Adds 'quic4@' / 'quic6@' as prefixes available for server addresses.
This is explicitely listed as experimental for now.

This must be backported up to 3.3.

9 days agoBUG/MEDIUM: map/cli: CLI commands lack admin permission checks
William Lallemand [Wed, 25 Mar 2026 13:57:08 +0000 (14:57 +0100)] 
BUG/MEDIUM: map/cli: CLI commands lack admin permission checks

The CLI commands (get|add|del|clear|commit|set) | (acl|map) does not
contain a permission check on admin level.

Must be backported to 3.3. This can be a breaking change for some users.

Initially reported by Cameron Brown.

9 days agoBUG/MEDIUM: ssl/ocsp: ocsp commands are missing permission checks
William Lallemand [Wed, 25 Mar 2026 13:47:10 +0000 (14:47 +0100)] 
BUG/MEDIUM: ssl/ocsp: ocsp commands are missing permission checks

'set ssl ocsp-response', 'update ssl ocsp-response', 'show ssl
ocsp-response', 'show ssl ocsp-updates' are lacking permissions checks
on admin level.

Must be backported in 3.3. This can be a breaking change for some users.

Initially reported by Cameron Brown.

9 days agoBUG/MEDIUM: ssl/cli: tls-keys commands are missing permission checks
William Lallemand [Wed, 25 Mar 2026 10:54:09 +0000 (11:54 +0100)] 
BUG/MEDIUM: ssl/cli: tls-keys commands are missing permission checks

Both 'set ssl tls-key' and 'show tls-keys' command are missing the
permission checks so the commands can be used only in admin mode.

Must be backported to 3.3. This can be a breaking change for some users.

Initially reported by Cameron Brown.

9 days agoBUG/MEDIUM: map/cli: map/acl commands warn when accessed without admin level
William Lallemand [Tue, 31 Mar 2026 09:36:08 +0000 (11:36 +0200)] 
BUG/MEDIUM: map/cli: map/acl commands warn when accessed without admin level

This commit adds an ha_warning() when map/acl commands are accessed
without admin level. This is to warn users that these commands will be
restricted to admin only in HAProxy 3.3.

Must be backported in every stable branches.

Initially reported by Cameron Brown.

9 days agoBUG/MEDIUM: ssl/ocsp: ocsp commands warn when accessed without admin level
William Lallemand [Tue, 31 Mar 2026 09:35:46 +0000 (11:35 +0200)] 
BUG/MEDIUM: ssl/ocsp: ocsp commands warn when accessed without admin level

This commit adds an ha_warning() when OCSP commands are accessed without
admin level. This is to warn users that these commands will be
restricted to admin only in HAProxy 3.3.

Must be backported in every stable branches.

Initially reported by Cameron Brown.

9 days agoBUG/MEDIUM: ssl/cli: tls-keys commands warn when accessed without admin level
William Lallemand [Tue, 31 Mar 2026 09:34:43 +0000 (11:34 +0200)] 
BUG/MEDIUM: ssl/cli: tls-keys commands warn when accessed without admin level

This commit adds an ha_warning() when 'show tls-keys' or 'set ssl
tls-key' are accessed without admin level. This is to warn users that
these commands will be restricted to admin only in HAProxy 3.3.

Must be backported in every stable branches.

Initially reported by Cameron Brown.

9 days agoSCRIPTS: git-show-backports: list new commits and how to review them with -L
Willy Tarreau [Tue, 31 Mar 2026 07:17:03 +0000 (09:17 +0200)] 
SCRIPTS: git-show-backports: list new commits and how to review them with -L

The new "-L" option is convenient for quick backport sessions, but it
doesn't list the commit subjects nor the review command. Let's just add
these to ease backport sessions. However we don't do it in quiet mode
(-q) because the output is sometimes parsed by automatic backport
scripts.

10 days agoDOC: configuration: document challenge-ready and dns-delay options for ACME
William Lallemand [Mon, 30 Mar 2026 15:36:51 +0000 (17:36 +0200)] 
DOC: configuration: document challenge-ready and dns-delay options for ACME

Add documentation for two new directives in the acme section:

- challenge-ready: configures the conditions that must be satisfied
  before notifying the ACME server that a dns-01 challenge is ready.
  Accepted values are cli, dns and none. cli waits for an operator
  to signal readiness via the "acme challenge_ready" CLI command. dns
  performs a DNS pre-check against the "default" resolvers section,
  not the authoritative name servers. When both are combined, HAProxy
  waits for the CLI confirmation before triggering the DNS check.

- dns-delay: configures the delay before the first DNS resolution
  attempt and between retries when challenge-ready includes dns.
  Default is 300 seconds.

10 days agoMEDIUM: acme: new 'challenge-ready' option
William Lallemand [Fri, 27 Mar 2026 11:18:47 +0000 (12:18 +0100)] 
MEDIUM: acme: new 'challenge-ready' option

The previous patch implemented the 'dns-check' option. This one replaces
it by a more generic  'challenge-ready' option, which allows the user to
chose the condition to validate the readiness of a challenge. It could
be 'cli', 'dns' or both.

When in dns-01 mode it's by default to 'cli' so the external tool used to
configure the TXT record can validate itself. If the tool does not
validate the TXT record, you can use 'cli,dns' so a DNS check would be
done after the CLI validated with 'challenge_ready'.

For an automated validation of the challenge, it should be set to 'dns',
this would check that the TXT record is right by itself.

10 days agoMEDIUM: acme: add dns-01 DNS propagation pre-check
William Lallemand [Tue, 24 Mar 2026 20:53:57 +0000 (21:53 +0100)] 
MEDIUM: acme: add dns-01 DNS propagation pre-check

When using the dns-01 challenge type, TXT record propagation across
DNS servers can take time. If the ACME server verifies the challenge
before the record is visible, the challenge fails and it's not possible
to trigger it again.

This patch introduces an optional DNS pre-check mechanism controlled
by two new configuration directives in the "acme" section:

  - "dns-check on|off": enable DNS propagation verification before
    notifying the ACME server (default: off)
  - "dns-delay <time>": delay before querying DNS (default: 300s)

When enabled, three new states are inserted in the state machine
between AUTH and CHALLENGE:

  - ACME_RSLV_WAIT: waits dns-delay seconds before starting
  - ACME_RSLV_TRIGGER: starts an async TXT resolution for each
    pending authorization using HAProxy's resolver infrastructure
  - ACME_RSLV_READY: compares the resolved TXT record against the
    expected token; retries from ACME_RSLV_WAIT if any record is
    missing or does not match

The "acme_rslv" structure is implemented in acme_resolvers.c, it holds
the resolution for each domain. The "auth" structure which contains each
challenge to resolve contains an "acme_rslv" structure. Once
ACME_RSLV_TRIGGER leaves, the DNS tasks run on the same thread, and the
last DNS task which finishes will wake up acme_process().

Note that the resolution goes through the configured resolvers, not
through the authoritative name servers of the domain. The result may
therefore still be affected by DNS caching at the resolver level.

10 days agoMINOR: acme: store the TXT record in auth->token
William Lallemand [Tue, 24 Mar 2026 20:51:23 +0000 (21:51 +0100)] 
MINOR: acme: store the TXT record in auth->token

In case of dns-01 challenge, replace the token by the TXT record which
is more pertinent and could be used later to verify if the record is
correct.

10 days agoMINOR: resolvers: basic TXT record implementation
William Lallemand [Tue, 24 Mar 2026 10:43:19 +0000 (11:43 +0100)] 
MINOR: resolvers: basic TXT record implementation

This patch adds support for TXT records. It allows to get the first
string of a TXT-record which is limited to 255 characters.
The rest of the record is ignored.

10 days agoBUILD: net_helper: fix unterminated comment that broke the build
Willy Tarreau [Mon, 30 Mar 2026 16:23:12 +0000 (18:23 +0200)] 
BUILD: net_helper: fix unterminated comment that broke the build

Latest commit a336c467a0 ("BUG/MINOR: net_helper: fix length controls
on ip.fp tcp options parsing") was malformed and broke the build. This
should be backported wherever the fix above is backported.

10 days agoBUG/MINOR: net_helper: fix length controls on ip.fp tcp options parsing
Emeric Brun [Wed, 25 Mar 2026 16:39:21 +0000 (17:39 +0100)] 
BUG/MINOR: net_helper: fix length controls on ip.fp tcp options parsing

If opt len is truncated by tcplen we may read 1 Byte after the
tcp header.

There is also missing controls parsing MSS and WS we may compute
invalid values on fingerprint reading after the tcp header in
case of truncated options.

This patch should be backported on versions including ip.fp

10 days agoMINOR: mux-h2: report glitches on early RST_STREAM
Willy Tarreau [Thu, 19 Mar 2026 17:00:20 +0000 (18:00 +0100)] 
MINOR: mux-h2: report glitches on early RST_STREAM

We leverage the SE_FL_APP_STARTED flag to detect whether the application
layer had a chance to run or not when an RST_STREAM is received. This
allows us to triage RST_STREAM between regular ones and harmful ones,
and to count glitches for them. It reveals extremely effective at
detecting fast HEADERS+RST pairs.

It could be useful to backport it to 3.2, though it depends on these
two previous patches to be backported first (the first one was already
planned and the second one is harmless, though will require to drop
the haterm changes):

  BUG/MINOR: stconn: Always declare the SC created from healthchecks as a back SC
  MINOR: stconn: flag the stream endpoint descriptor when the app has started

10 days agoMINOR: stconn: flag the stream endpoint descriptor when the app has started
Willy Tarreau [Mon, 30 Mar 2026 14:19:51 +0000 (16:19 +0200)] 
MINOR: stconn: flag the stream endpoint descriptor when the app has started

In order to improve our ability to distinguish operations that had
already started from others under high loads, it would be nice to know
if an application layer (stream) has started to work with an endpoint
or not. The use case typically is a frontend mux instantiating a stream
to instantly cancel it. Currently this info will take some time to be
detected and processed if the applcation's task takes time to wake up.
By flagging the sedesc with SE_FL_APP_STARTED the first time a the app
layer starts, the lower layers can know whether they're cancelling a
stream that has started to work or not, and act accordingly. For now
this is done unconditionally on the backend, and performed early in the
only two app layers that can be reached by a frontend: process_stream()
and process_hstream() (for haterm).

10 days agoBUG/MINOR: stconn: Always declare the SC created from healthchecks as a back SC
Christopher Faulet [Mon, 30 Mar 2026 13:24:52 +0000 (15:24 +0200)] 
BUG/MINOR: stconn: Always declare the SC created from healthchecks as a back SC

The SC created from a healthcheck is always a back SC. But SC_FL_ISBACK
flags was missing. Instead of passing it when sc_new_from_check() is called,
the function was simplified to set SC_FL_ISBACK flag systematically when a
SC is created from a healthcheck.

This patch should be backported as far as 2.6.

10 days agoCLEANUP: stconn: Remove usless sc_new_from_haterm() declaration
Christopher Faulet [Mon, 30 Mar 2026 13:23:47 +0000 (15:23 +0200)] 
CLEANUP: stconn: Remove usless sc_new_from_haterm() declaration

This function does not exist. Let's remove its declaration.

10 days agoBUG/MINOR: quic: close conn on packet reception with incompatible frame
Amaury Denoyelle [Mon, 30 Mar 2026 07:38:13 +0000 (09:38 +0200)] 
BUG/MINOR: quic: close conn on packet reception with incompatible frame

RFC 9000 lists each supported frames and the type of packets in which it
can be present.

Prior to this patch, a packet with an incompatible frame is dropped.
However, QUIC specification mandates that the connection is immediately
closed with PROTOCOL_VIOLATION error code. This patch completes
qc_parse_frm() to add such connection closure.

This must be backported up to 2.6.

10 days agoCLEANUP: fix typos and spelling in comments and documentation
Ilia Shipitsin [Sun, 29 Mar 2026 17:22:19 +0000 (19:22 +0200)] 
CLEANUP: fix typos and spelling in comments and documentation

Corrected multiple spelling mistakes across CLI scripts, documentation,
and source comments (e.g. "Specifiy" â†’ "Specify", "explicitely" â†’ "explicitly",
"transfert" â†’ "transfer", "resetted" â†’ "reset", etc.). These changes
improve readability and consistency without altering functionality.

10 days agoCI: github: fix tag listing by implementing proper API pagination
Ilia Shipitsin [Sun, 29 Mar 2026 16:30:02 +0000 (18:30 +0200)] 
CI: github: fix tag listing by implementing proper API pagination

The GitHub API silently caps per_page at 100, so passing per_page=200
was silently returning at most 100 tags. AWS-LC-FIPS tags appear late
in the list, causing version detection to fail.

Replace the single-page fetch in get_all_github_tags() with a loop that
iterates all pages.

Could be backported in previous branches.

13 days agoBUG/MEDIUM: htx: Fix htx_xfer() to consume more data than expected
Christopher Faulet [Fri, 27 Mar 2026 16:12:18 +0000 (17:12 +0100)] 
BUG/MEDIUM: htx: Fix htx_xfer() to consume more data than expected

When an htx DATA block is partially transfer, we must take care to remove
exactly the copied size. To do so, we must save the size of the last block
value copied and not rely on the last data block after the copy. Indeed,
data can be merged with an existing DATA block, so the last block size can
be larger than the last part copied.

Because of this issue, it is possible to remove more data than
expected. Worse, this could lead to a crash by performing an integer
overflow on the block size.

No backport needed.

13 days agoBUG/MINOR: acme: fix task allocation leaked upon error
William Lallemand [Fri, 27 Mar 2026 15:56:47 +0000 (16:56 +0100)] 
BUG/MINOR: acme: fix task allocation leaked upon error

Fix a leak of the task object in acme_start_task() when one of the
condition in the function failed.

Fix issue #3308.

Must be backported to 3.2 and later.

13 days agoMINOR: connections: Enhance tune.idle-pool.shared
Olivier Houchard [Thu, 26 Mar 2026 15:53:47 +0000 (16:53 +0100)] 
MINOR: connections: Enhance tune.idle-pool.shared

There are two settings to control idle connection sharing across
threads.
tune.idle-pool.shared, that enables or disables it, and then
tune.takeover-other-tg-connections, which lets you or not get idle
connections from other thread groups.
Add a new keyword for tune.idle-pool.shared, "full", that lets you get
connections from other thread groups (equivalent to "full" keyword for
tune.takeover-other-tg-connections). The "on" keyword now will be
equivalent to the "restrict" one, which allowed getting connection from
other thread groups only when not doing it would result in a connection
failure (when reverse-http or when strict-macxonn are used).
tune.takeover-other-tg-connections will be deprecated.

13 days agoBUG/MEDIUM: acme: skip doing challenge if it is already valid
Mia Kanashi [Sun, 22 Feb 2026 23:04:46 +0000 (01:04 +0200)] 
BUG/MEDIUM: acme: skip doing challenge if it is already valid

If server returns an auth with status valid it seems that client
needs to always skip it, CA can recycle authorizations, without
this change haproxy fails to obtain certificates in that case.
It is also something that is explicitly allowed and stated
in the dns-persist-01 draft RFC.

Note that it would be better to change how haproxy does status polling,
and implements the state machine, but that will take some thought
and time, this patch is a quick fix of the problem.

See:
https://github.com/letsencrypt/boulder/issues/2125
https://github.com/letsencrypt/pebble/issues/133

This must be backported to 3.2 and later.

13 days agoBUG/MINOR: http-ana: Only consider client abort for abortonclose
Christopher Faulet [Fri, 27 Mar 2026 10:18:39 +0000 (11:18 +0100)] 
BUG/MINOR: http-ana: Only consider client abort for abortonclose

When abortonclose option is enabled (by default since 3.3), the HTTP rules
can no longer yield if the client aborts. However, stream aborts were also
considered. So it was possible to interrupt yielding rules, especially on
the response processing, while the client was still waiting for the
response.

So now, when abortonclose option is enabled, we now take care to only
consider client aborts to prevent HTTP rules to yield.

Many thanks to @DirkyJerky for his detailed analysis.

This patch should fix the issue #3306. It should be backported as far as
2.8.

2 weeks agoBUG/MINOR: config: Properly test warnif_misplaced_* return values
Christopher Faulet [Tue, 24 Mar 2026 17:21:13 +0000 (18:21 +0100)] 
BUG/MINOR: config: Properly test warnif_misplaced_* return values

warnif_misplaced_* functions return 1 when a warning is reported and 0
otherwise. So the caller must properly handle the return value.

When parsing a proxy, ERR_WARN code must be added to the error code instead
of the return value. When a warning was reported, ERR_RETRYABLE (1) was
added instead of ERR_WARN.

And when tcp rules were parsed, warnings were ignored. Message were emitted
but the return values were ignored.

This patch should be backported to all stable versions.

2 weeks agoBUG/MINOR: config: Warn only if warnif_cond_conflicts report a conflict
Christopher Faulet [Tue, 24 Mar 2026 17:16:52 +0000 (18:16 +0100)] 
BUG/MINOR: config: Warn only if warnif_cond_conflicts report a conflict

When warnif_cond_conflicts() is called, we must take care to emit a warning
only when a conflict is reported. We cannot rely on the err_code variable
because some warnings may have been already reported. We now rely on the
errmsg variable. If it contains something, a warning is emitted. It is good
enough becasue warnif_cond_conflicts() only reports warnings.

This patch should fix the issue #3305. It is a 3.4-dev specific issue. No
backport needed.

2 weeks agoMEDIUM: server: remove a useless memset() in srv_update_check_addr_port.
Olivier Houchard [Thu, 26 Mar 2026 15:43:48 +0000 (16:43 +0100)] 
MEDIUM: server: remove a useless memset() in srv_update_check_addr_port.

Remove a memset that should not be there, and tries to zero a NULL pointer.

2 weeks agoMEDIUM: connections: Enforce mux protocol requirements
Olivier Houchard [Thu, 19 Mar 2026 14:00:41 +0000 (15:00 +0100)] 
MEDIUM: connections: Enforce mux protocol requirements

When picking a mux, pay attention to its MX_FL_FRAMED. If it is set,
then it means we explicitely want QUIC, so don't use that mux for any
protocol that is not QUIC.

2 weeks agoMINOR: protocols: Add a new proto_is_quic() function
Olivier Houchard [Thu, 19 Mar 2026 14:36:25 +0000 (15:36 +0100)] 
MINOR: protocols: Add a new proto_is_quic() function

Add a new function, proto_is_quic(), that returns true if the protocol
is QUIC (using a datagram socket but provides a stream transport).

2 weeks agoMINOR: checks: Store the protocol to be used in struct check
Olivier Houchard [Thu, 19 Mar 2026 13:28:42 +0000 (14:28 +0100)] 
MINOR: checks: Store the protocol to be used in struct check

When parsing the check address, store the associated proto too.
That way we can use the notation like quic4@address, and the right
protocol will be used. It is possible for checks to use a different
protocol than the server, ie we can have a QUIC server but want to run
TCP checks, so we can't just reuse whatever the server uses.
WIP: store the protocol in checks

2 weeks agoBUG/MEDIUM: check: Don't reuse the server xprt if we should not
Olivier Houchard [Tue, 24 Mar 2026 14:51:34 +0000 (15:51 +0100)] 
BUG/MEDIUM: check: Don't reuse the server xprt if we should not

Don't assume the check will reuse the server's xprt. It may not be true
if some settings such as the ALPN has been set, and it differs from the
server's one. If the server is QUIC, and we want to use TCP for checks,
we certainly don't want to reuse its XPRT.

2 weeks agoBUG/MINOR: acme: permission checks on the CLI
William Lallemand [Wed, 25 Mar 2026 10:49:22 +0000 (11:49 +0100)] 
BUG/MINOR: acme: permission checks on the CLI

Permission checks on the CLI for ACME are missing.

This patch adds a check on the ACME commands
so they can only be run in admin mode.

ACME is stil a feature in experimental-mode.

Initial report by Cameron Brown.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: ech: permission checks on the CLI
William Lallemand [Wed, 25 Mar 2026 10:20:24 +0000 (11:20 +0100)] 
BUG/MINOR: ech: permission checks on the CLI

Permission checks on the CLI for ECH are missing.

This patch adds a check for "(add|set|del|show) ssl ech" commands
so they can only be run in admin mode.

ECH is stil a feature in experimental-mode and is not compiled by
default.

Initial report by Cameron Brown.

Must be backported to 3.3.

2 weeks agoBUILD: tools: potential null pointer dereference in dl_collect_libs_cb
William Lallemand [Mon, 23 Mar 2026 20:48:36 +0000 (21:48 +0100)] 
BUILD: tools: potential null pointer dereference in dl_collect_libs_cb

This patch fixes a warning that can be reproduced with gcc-8.5 on RHEL8
(gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28)).

This should fix issue #3303.

Must be backported everywhere 917e82f283 ("MINOR: debug: copy debug
symbols from /usr/lib/debug when present") was backported, which is
to branch 3.2 for now.

2 weeks agoBUG/MINOR: acme/cli: fix argument check and error in 'acme challenge_ready'
William Lallemand [Mon, 23 Mar 2026 13:32:28 +0000 (14:32 +0100)] 
BUG/MINOR: acme/cli: fix argument check and error in 'acme challenge_ready'

Fix the check or arguments of the 'acme challenge_ready' command which
was checking if all arguments are NULL instead of one of the argument.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: acme: replace atol with len-bounded __strl2uic() for retry-after
William Lallemand [Mon, 23 Mar 2026 13:15:04 +0000 (14:15 +0100)] 
BUG/MINOR: acme: replace atol with len-bounded __strl2uic() for retry-after

Replace atol() by _strl2uic() in cases the input are ISTs when parsing
the retry-after header. There's no risk of an error since it will stop
at the first non-digit.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: acme: free() DER buffer on a2base64url error path
William Lallemand [Mon, 23 Mar 2026 13:02:48 +0000 (14:02 +0100)] 
BUG/MINOR: acme: free() DER buffer on a2base64url error path

In acme_req_finalize() the data buffer is only freed when a2base64url
succeed. This patch moves the allocation so it free() the DER buffer in
every cases.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: acme: NULL check on my_strndup()
William Lallemand [Mon, 23 Mar 2026 12:57:48 +0000 (13:57 +0100)] 
BUG/MINOR: acme: NULL check on my_strndup()

Add a NULL check on my_strndup().

Must be backported to 3.2 and later.

2 weeks agoDOC: config: Reorder params for 'tcp-check expect' directive
Christopher Faulet [Fri, 20 Mar 2026 10:36:44 +0000 (11:36 +0100)] 
DOC: config: Reorder params for 'tcp-check expect' directive

Order of parameters for the 'tcp-check expect' directive is changed to be
the same than 'http-check expect'.

2 weeks agoDOC: config: Add missing 'status-code' param for 'http-check expect' directive
Christopher Faulet [Fri, 20 Mar 2026 10:33:32 +0000 (11:33 +0100)] 
DOC: config: Add missing 'status-code' param for 'http-check expect' directive

In the documentation of 'http-check expect' directive, the parameter
'status-code' was missing. Let's add it.

This patch could be backported to all stable versions.

2 weeks agoMINOR: proxy: Add use-small-buffers option to set where to use small buffers
Christopher Faulet [Thu, 19 Mar 2026 13:19:37 +0000 (14:19 +0100)] 
MINOR: proxy: Add use-small-buffers option to set where to use small buffers

Thanks to previous commits, it is possible to use small buffers at different
places: to store the request when a connection is queued or when L7 retries
are enabled, or for health-checks requests. However, there was no
configuration parameter to fine tune small buffer use.

It is now possible, thanks to the proxy option "use-small-buffers".
Documentation was updated accordingly.

2 weeks agoDOC: config: Fix alphabetical ordering of external-check directives
Christopher Faulet [Thu, 19 Mar 2026 12:59:31 +0000 (13:59 +0100)] 
DOC: config: Fix alphabetical ordering of external-check directives

external-check directives were not at the right place. Let's fix it.

2 weeks agoDOC: config: Fix alphabetical ordering of proxy options
Christopher Faulet [Thu, 19 Mar 2026 12:55:56 +0000 (13:55 +0100)] 
DOC: config: Fix alphabetical ordering of proxy options

external-check and idle-close-on-response options were not at the right
place. Let's fix it.

2 weeks agoMINOR: proxy: Review options flags used to configure healthchecks
Christopher Faulet [Thu, 19 Mar 2026 10:22:52 +0000 (11:22 +0100)] 
MINOR: proxy: Review options flags used to configure healthchecks

When healthchecks were configured for a proxy, an enum-like was used to
sepcify the check's type. The idea was to reserve some values for futur
types of healthcheck. But it is overkill. I doubt we will ever have
something else than tcp and external checks. So corresponding PR_O2 flags
were slightly reviewed and a hole was filled.

Thanks to this change, some bits were released in options2 bitfield.

2 weeks agoMEDIUM: tcpcheck: Use small buffer if possible for healthchecks
Christopher Faulet [Thu, 19 Mar 2026 09:57:36 +0000 (10:57 +0100)] 
MEDIUM: tcpcheck: Use small buffer if possible for healthchecks

If support for small buffers is enabled, we now try to use them for
healthcheck requests. First, we take care the tcpcheck ruleset may use small
buffers. Send rules using LF strings or too large data are excluded. The
ability to use small buffers or not are set on the ruleset. All send rules
of the ruleset must be compatible. This info is then transfer to server's
healthchecks relying on this ruleset.

Then, when a healthcheck is running, when a send rule is evaluated, if
possible, we try to use small buffers. On error, the ability to use small
buffers is removed and we retry with a regular buffer. It means on the first
error, the support is disabled for the healthcheck and all other runs will
use regular buffers.

2 weeks agoMEDIUM: mux-h2: Stop dealing with HTX flags transfer in h2_rcv_buf()
Christopher Faulet [Tue, 17 Mar 2026 18:08:54 +0000 (19:08 +0100)] 
MEDIUM: mux-h2: Stop dealing with HTX flags transfer in h2_rcv_buf()

In h2_rcv_buf(), HTX flags are transfer with data when htx_xfer() is
called. There is no reason to continue to deal with them in the H2 mux. In
addition, there is no reason to set SE_FL_EOI flag when a parsing error was
reported. This part was added before the stconn era. Nowadays, when an HTX
parsing error is reported, an error on the sedesc should also be reported.

2 weeks agoRevert "BUG/MEDIUM: mux-h2: make sure to always report pending errors to the stream"
Christopher Faulet [Tue, 17 Mar 2026 07:48:49 +0000 (08:48 +0100)] 
Revert "BUG/MEDIUM: mux-h2: make sure to always report pending errors to the stream"

This reverts commit 44932b6c417e472d25039ec3d7b8bf14e07629bc.

The patch above was only necessary to handle partial headers or trailers
parsing. There was nothing to prevent the H2 multiplexer to start to add
headers or trailers in an HTX message and to stop the processing on error,
leaving the HTX message with no EOH/EOT block.

From the HTX API point of view, it is unexepected. And this was fixed thanks
to the commit ba7dc46a9 ("BUG/MINOR: h2/h3: Never insert partial
headers/trailers in an HTX message").

So this patch can be reverted. It is important to not report a parsign error
too early, when there are still data to transfer to the upper layer.

This patch must be backport where 44932b6c4 was backported but only after
backporting ba7dc46a9 first.

2 weeks agoMEDIUM: tree-wide: Rely on htx_xfer() instead of htx_xfer_blks()
Christopher Faulet [Tue, 17 Mar 2026 07:03:07 +0000 (08:03 +0100)] 
MEDIUM: tree-wide: Rely on htx_xfer() instead of htx_xfer_blks()

htx_xfer() function replaced htx_xfer_blks(). So let's use it.

2 weeks agoMEDIUM: stconn: Use a small buffer if possible for L7 retries
Christopher Faulet [Mon, 16 Mar 2026 10:25:35 +0000 (11:25 +0100)] 
MEDIUM: stconn: Use a small buffer if possible for L7 retries

Whe L7 retries are enabled and the request is small enough, a small buffer
is used instead of a regular one.

2 weeks agoMEDIUM: stream: Try to use small buffer when TCP stream is queued
Christopher Faulet [Tue, 10 Mar 2026 15:27:03 +0000 (16:27 +0100)] 
MEDIUM: stream: Try to use small buffer when TCP stream is queued

It was performed when an HTX stream was queued. Small requests were moved in
small buffers. Here we do the same but for TCP streams.

2 weeks agoMEDIUM: stream: Try to use a small buffer for HTTP request on queuing
Christopher Faulet [Mon, 9 Mar 2026 17:10:17 +0000 (18:10 +0100)] 
MEDIUM: stream: Try to use a small buffer for HTTP request on queuing

When a HTX stream is queued, if the request is small enough, it is moved
into a small buffer. This should save memory on instances intensively using
queues.

Applet and connection receive function were update to block receive when a
small buffer is in use.

2 weeks agoMEDIUM: chunk: Add support for small chunks
Christopher Faulet [Thu, 19 Mar 2026 14:21:26 +0000 (15:21 +0100)] 
MEDIUM: chunk: Add support for small chunks

In the same way support for large chunks was added to properly work with
large buffers, we are now adding supports for small chunks because it is
possible to process small buffers.

So a dedicated memory pool is added to allocate small
chunks. alloc_small_trash_chunk() must be used to allocate a small
chunk. alloc_trash_chunk_sz() and free_trash_chunk() were uppdated to
support small chunks.

In addition, small trash buffers are also created, using the same mechanism
than for regular trash buffers. So three thread-local trash buffers are
created. get_small_trash_chunk() must be used to get a small trash buffer.
And get_trash_chunk_sz() was updated to also deal with small buffers.

2 weeks agoMINOR: http-ana: Use HTX API to move to a large buffer
Christopher Faulet [Tue, 10 Mar 2026 07:11:35 +0000 (08:11 +0100)] 
MINOR: http-ana: Use HTX API to move to a large buffer

Use htx_move_to_large_buffer() to move a regular HTX message to a large
buffer when we are waiting for a huge payload.

2 weeks agoMINOR: htx: Add helper functions to xfer a message to smaller or larger one
Christopher Faulet [Tue, 10 Mar 2026 07:10:29 +0000 (08:10 +0100)] 
MINOR: htx: Add helper functions to xfer a message to smaller or larger one

htx_move_to_small_buffer()/htx_move_to_large_buffer() and
htx_copy_to_small_buffer()/htx_copy_to_large_buffer() functions can now be
used to move or copy blocks from a default buffer to a small or large
buffer. The destination buffer is allocated and then each blocks are
transferred into it.

These funtions relies in htx_xfer() function.

2 weeks agoMEDIUM: htx: Add htx_xfer function to replace htx_xfer_blks
Christopher Faulet [Mon, 16 Mar 2026 07:50:42 +0000 (08:50 +0100)] 
MEDIUM: htx: Add htx_xfer function to replace htx_xfer_blks

htx_xfer() function should replace htx_xfer_blks(). It will be a bit easier to
maintain and to use. The behavior of htx_xfer() can be changed by calling it
with specific flags:

  * HTX_XFER_KEEP_SRC_BLKS: Blocks from the source message are just copied
  * HTX_XFER_PARTIAL_HDRS_COPY: It is allowed to partially xfer headers or trailers
  * HTX_XFER_HDRS_ONLY: only headers are xferred

By default (HTX_XFER_DEFAULT or 0), all blocks from the source message are moved
into to the destination mesage. So copied in the destination messageand removed
from the source message.

The caller must still define the maximum amount of data (including meta-data)
that can be xferred.

It is no longer necessary to specify a block type to stop the copy. Most of
time, with htx_xfer_blks(), this parameter was set to HTX_BLK_UNUSED. And
otherwise it was only specified to transfer headers.

It is important to not that the caller is responsible to verify the original
HTX message is well-formated. Especially, it must be sure headers part and
trailers part are complete (finished by EOH/EOT block).

For now, htx_xfer_blks() is not removed for compatiblity reason. But it is
deprecated.

2 weeks agoMINOR: config: Report the warning when invalid large buffer size is set
Christopher Faulet [Tue, 10 Mar 2026 17:50:36 +0000 (18:50 +0100)] 
MINOR: config: Report the warning when invalid large buffer size is set

When an invalid large buffer size was found in the configuration, a warning
was emitted but it was not reported via the error code. It is now fixed.

2 weeks agoMINOR: config: Relax tests on the configured size of small buffers
Christopher Faulet [Tue, 10 Mar 2026 17:48:05 +0000 (18:48 +0100)] 
MINOR: config: Relax tests on the configured size of small buffers

When small buffer size was greater than the default buffer size, an error
was triggered. We now do the same than for large buffer. A warning is
emitted and the small buffer size is set to 0 do disable small buffer
allocation.

2 weeks agoMINOR: quic: Use b_alloc_small() to allocate a small buffer
Christopher Faulet [Tue, 10 Mar 2026 07:12:15 +0000 (08:12 +0100)] 
MINOR: quic: Use b_alloc_small() to allocate a small buffer

Rely on b_alloc_small to allocate a small buffer.

2 weeks agoMINOR: dynbuf: Add helper functions to alloc large and small buffers
Christopher Faulet [Tue, 10 Mar 2026 07:09:12 +0000 (08:09 +0100)] 
MINOR: dynbuf: Add helper functions to alloc large and small buffers

b_alloc_small() and b_alloc_large() can now be used to alloc small or larger
buffers. For now, unlike default buffers, buffer_wait lists are not used.

2 weeks agoMINOR: buffers: Move small buffers management from quic to dynbuf part
Christopher Faulet [Mon, 9 Mar 2026 06:38:22 +0000 (07:38 +0100)] 
MINOR: buffers: Move small buffers management from quic to dynbuf part

Because small buffers were only used by QUIC streams, the pool used to alloc
these buffers was located in the quic code. However, their usage will be
extended to other parts. So, the small buffers pool was moved into the
dynbuf part.

2 weeks agoBUG/MINOR: http_htx: fix null deref in http-errors config check
Amaury Denoyelle [Mon, 23 Mar 2026 12:50:17 +0000 (13:50 +0100)] 
BUG/MINOR: http_htx: fix null deref in http-errors config check

http-errors parsing has been refactored in a recent serie of patches.
However, a null deref was introduced by the following patch in case a
non-existent http-errors section is referenced by an "errorfiles"
directive.

  commit 2ca7601c2d6781f455cf205e4f3b52f5beb16e41
  MINOR/OPTIM: http_htx: lookup once http_errors section on check/init

Fix this by delaying ha_free() so that it is called after ha_alert().

No need to backport.

2 weeks agoBUG/MINOR: acme/cli: wrong argument check in 'acme renew'
William Lallemand [Mon, 23 Mar 2026 10:15:55 +0000 (11:15 +0100)] 
BUG/MINOR: acme/cli: wrong argument check in 'acme renew'

Argument check should be args[2] instead of args[1] which is always
'renew'.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: acme: wrong error when checking for duplicate section
William Lallemand [Mon, 23 Mar 2026 10:22:49 +0000 (11:22 +0100)] 
BUG/MINOR: acme: wrong error when checking for duplicate section

The cfg_parse_acme() function checks if an 'acme' section is already
existing in the configuration with cur_acme->linenum > 0. But the wrong
filename and line number are displayed in the commit message.

Must be backported to 3.2 and later.

2 weeks agoBUG/MINOR: acme: leak of ext_san upon insertion error
William Lallemand [Mon, 23 Mar 2026 10:42:43 +0000 (11:42 +0100)] 
BUG/MINOR: acme: leak of ext_san upon insertion error

This patch fixes a leak of the ext_san structure when
sk_X509_EXTENSION_push() failed. sk_X509_EXTENSION_pop_free() is already
suppose to free it, so ext_san must be set to NULL upon success to avoid
a double-free.

Must be backported to 3.2 and later.

2 weeks agoMEDIUM: proxy: remove http-errors limitation for dynamic backends
Amaury Denoyelle [Wed, 18 Mar 2026 15:22:11 +0000 (16:22 +0100)] 
MEDIUM: proxy: remove http-errors limitation for dynamic backends

Use proxy_check_http_errors() on defaults proxy instances. This will
emit alert messages for errorfiles directives referencing a non-existing
http-errors section, or a warning if an explicitely listed status code
is not present in the target section.

This is a small behavior changes, as previouly this was only performed
for regular proxies. Thus, errorfile/errorfiles directives in an unused
defaults were never checked.

This may prevent startup of haproxy with a configuration file previously
considered as valid. However, this change is considered as necessary to
be able to use http-errors with dynamic backends. Any invalid defaults
will be detected on startup, rather than having to discover it at
runtime via "add backend" invokation.

Thus, any restriction on http-errors usage is now lifted for the
creation of dynamic backends.

2 weeks agoMINOR/OPTIM: http_htx: lookup once http_errors section on check/init
Amaury Denoyelle [Wed, 18 Mar 2026 15:49:33 +0000 (16:49 +0100)] 
MINOR/OPTIM: http_htx: lookup once http_errors section on check/init

The previous patch has splitted the original proxy_check_errors()
function in two, so that check and init steps are performed separately.
However, this renders the code inefficient for "errorfiles" directive as
tree lookup on http-errors section is performed twice.

Optimize this by adding a reference to the section in conf_errors
structure. This is resolved during proxy_check_http_errors() and
proxy_finalize_http_errors() can reuse it.

No need to backport.

2 weeks agoMINOR: http_htx: split check/init of http_errors
Amaury Denoyelle [Wed, 18 Mar 2026 15:21:37 +0000 (16:21 +0100)] 
MINOR: http_htx: split check/init of http_errors

Function proxy_check_errors() is used when configuration parsing is
over. This patch splits it in two newly named ones.

The first function is named proxy_check_http_errors(). It is responsible
to check for the validity of any "errorfiles" directive which could
reference non-existent http-errors section or code not defined in such
section. This function is now called via proxy_finalize().

The second function is named proxy_finalize_http_errors(). It converts
each conf_errors type used during parsing in a proper http_reply type
for runtime usage. This function is still called via post-proxy-check,
after proxy_finalize().

This patch does not bring any functional change. However, it will become
necessary to ensure http-errors can be used as expected with dynamic
backends.

2 weeks agoMINOR: http_htx: rename fields in struct conf_errors
Amaury Denoyelle [Wed, 18 Mar 2026 16:04:46 +0000 (17:04 +0100)] 
MINOR: http_htx: rename fields in struct conf_errors

This patch is the second part of the refactoring for http-errors
parsing. It renames some fields in <conf_errors> structure to clarify
their usage. In particular, union variants are renamed "inl"/"section",
which better highlight the link with the newly defined enum
http_err_directive.

2 weeks agoMINOR: http_htx: use enum for arbitrary values in conf_errors
Amaury Denoyelle [Mon, 16 Mar 2026 15:50:00 +0000 (16:50 +0100)] 
MINOR: http_htx: use enum for arbitrary values in conf_errors

In conf_errors struct, arbitrary integer values were used for both
<type> field and <status> array. This renders the code difficult to
follow.

Replaces these values with proper enums type. Two new types are defined
for each of these fields. The first one represents the directive type,
derived from the keyword used (errorfile vs errorfiles). This directly
represents which part of <info> union should be manipulated.

The second enum is used for errorfiles directive with a reference on a
http-errors section. It indicates whether or not if a status code should
be imported from this section, and if this import is explicit or
implicit.

2 weeks agoBUG/MEDIUM: acme: fix multiple resource leaks in acme_x509_req()
David Carlier [Fri, 20 Mar 2026 16:39:28 +0000 (16:39 +0000)] 
BUG/MEDIUM: acme: fix multiple resource leaks in acme_x509_req()

Several resources were leaked on both success and error paths:

- X509_NAME *nm was never freed. X509_REQ_set_subject_name() makes
  an internal copy, so nm must be freed separately by the caller.
- str_san allocated via my_strndup() was never freed on either path.
- On error paths after allocation, x (X509_REQ) and exts
  (STACK_OF(X509_EXTENSION)) were also leaked.

Fix this by adding proper cleanup of all allocated resources in both
the success and error paths. Also move sk_X509_EXTENSION_pop_free()
after X509_REQ_sign() so it is not skipped when sign fails, and
initialize nm to NULL to make early error paths safe.

Must be backported as far as 3.2.

2 weeks agoBUILD: sched: fix leftover of debugging test in single-run changes
Willy Tarreau [Mon, 23 Mar 2026 06:29:43 +0000 (07:29 +0100)] 
BUILD: sched: fix leftover of debugging test in single-run changes

There was a leftover of "activity[tid].ctr1++" in commit 7d40b3134
("MEDIUM: sched: do not run a same task multiple times in series")
that unfortunately only builds in development mode :-(

2 weeks agoMINOR: mux-h2: assign a limited frames processing budget
Willy Tarreau [Sat, 21 Mar 2026 15:19:49 +0000 (15:19 +0000)] 
MINOR: mux-h2: assign a limited frames processing budget

This introduces 3 new settings: tune.h2.be.max-frames-at-once and
tune.h2.fe.max-frames-at-once, which limit the number of frames that
will be processed at once for backend and frontend side respectively,
and tune.h2.fe.max-rst-at-once which limits the number of RST_STREAM
frames processed at once on the frontend.

We can now yield when reading too many frames at once, which allows to
limit the latency caused by processing too many frames in large buffers.
However if we stop due to the RST budget being depleted, it's most likely
the sign of a protocol abuse, so we make the tasklet go to BULK since
the goal is to punish it.

By limiting the number of RST per loop to 1, the SSL response time drops
from 95ms to 1.6ms during an H2 RST flood attack, and the maximum SSL
connection rate drops from 35.5k to 28.0k instead of 11.8k. A moderate
SSL load that shows 1ms response time and 23kcps increases to 2ms with
15kcps versus 95ms and 800cps before. The average loop time goes down
from 270-280us to 160us, while still doubling the attack absorption
rate with the same CPU capacity.

This patch may usefully be backported to 3.3 and 3.2. Note that to be
effective, this relies on the following patches:

  MEDIUM: sched: do not run a same task multiple times in series
  MINOR: sched: do not requeue a tasklet into the current queue
  MINOR: sched: do not punish self-waking tasklets anymore
  MEDIUM: sched: do not punish self-waking tasklets if TASK_WOKEN_ANY
  MEDIUM: sched: change scheduler budgets to lower TL_BULK

2 weeks agoMEDIUM: sched: change scheduler budgets to lower TL_BULK
Willy Tarreau [Sat, 21 Mar 2026 16:45:13 +0000 (16:45 +0000)] 
MEDIUM: sched: change scheduler budgets to lower TL_BULK

Having less yielding tasks in TL_BULK and more in TL_NORMAL, we need
to rebalance these queues' priorities. Tests have shown that raising
TL_NORMAL to 40% and lowering TL_BULK to 3% seems to give about the
best tradeoffs.

2 weeks agoMEDIUM: sched: do not punish self-waking tasklets if TASK_WOKEN_ANY
Willy Tarreau [Sat, 21 Mar 2026 14:58:59 +0000 (14:58 +0000)] 
MEDIUM: sched: do not punish self-waking tasklets if TASK_WOKEN_ANY

Self-waking tasklets are currently punished and go to the BULK list.
However it's a problem with muxes or the stick-table purge that just
yield and wake themselves up to limit the latency they cause to the
rest of the process, because by doing so to help others, they punish
themselves. Let's check if any TASK_WOKEN_ANY flag is present on
the tasklet and stop sending tasks presenting such a flag to TL_BULK.
Since tasklet_wakeup() by default passes TASK_WOKEN_OTHER, it means
that such tasklets will no longer be punished. However, tasks which
only want a best-effort wakeup can simply pass 0.

It's worth noting that a comparison was made between going into
TL_BULK at all and only setting the TASK_SELF_WAKING flag, and
it shows that the average latencies are ~10% better when entirely
avoiding TL_BULK in this case.

2 weeks agoMINOR: sched: do not punish self-waking tasklets anymore
Willy Tarreau [Sat, 21 Mar 2026 16:40:59 +0000 (16:40 +0000)] 
MINOR: sched: do not punish self-waking tasklets anymore

Nowadays due to yield etc, it's counter-productive to permanently
punish self-waking tasklets, let's abandon this principle as it prevent
finer task priority handling.

We continue to check for the TASK_SELF_WAKING flag to place a task
into TL_BULK in case some code wants to make use of it in the future
(similarly to TASK_HEAVY), but no code sets it anymore. It could
possible make sense in the future to replace this flag with a one-shot
variant requesting low-priority.

2 weeks agoMINOR: sched: do not requeue a tasklet into the current queue
Willy Tarreau [Sat, 21 Mar 2026 14:52:52 +0000 (14:52 +0000)] 
MINOR: sched: do not requeue a tasklet into the current queue

As found by Christopher, the concept of waking a tasklet up into the
current queue is totally flawed, because if a task is in TL_BULK or
TL_HEAVY, all the tasklets it will wake up will end up in the same
queue. Not only this will clobber such queues, but it will also
reduce their quality of service, and this can contaminate other
tasklets due to the numerous wakeups there are now with the subsribe
mechanism between layers.

2 weeks agoMEDIUM: sched: do not run a same task multiple times in series
Willy Tarreau [Sat, 21 Mar 2026 14:47:09 +0000 (14:47 +0000)] 
MEDIUM: sched: do not run a same task multiple times in series

There's always a risk that some tasks run multiple times if they wake
each other up. Now we include the loop counter in the task struct and
stop processing the queue it's in when meeting a task that has already
run. We only pick 16 bits since that's only what remains free in the
task common part, so from time to time (once every 65536) it will be
possible to wrongly match a task as having already run and stop evaluating
its queue, but it's rare enough that we don't care, because this will
be OK on the next iteration.

2 weeks agoBUG/MINOR: qpack: fix 62-bit overflow and 1-byte OOB reads in decoding
Frederic Lecaille [Fri, 20 Mar 2026 18:30:35 +0000 (19:30 +0100)] 
BUG/MINOR: qpack: fix 62-bit overflow and 1-byte OOB reads in decoding

This patch improves the robustness of the QPACK varint decoder and fixes
potential 1-byte out-of-bounds reads in qpack_decode_fs().

In qpack_decode_fs(), two 1-byte OOB reads were possible on truncated
streams between two varint decoding. These occurred when trying to read
the byte containing the Huffman bit <h> and the Value Length prefix
immediately following an Index or a Name Length.

Note that these OOB are limited to a single byte because
qpack_get_varint() already ensures that its input length is non-zero
before consuming any data.

The fixes in qpack_decode_fs() are:
- When decoding an index, we now verify that at least one byte remains
  to safely access the following <h> bit and value length.
- When decoding a literal, we now check len < name_len + 1 to ensure
  the byte starting the header value is reachable.

In qpack_get_varint(), the maximum value is now strictly capped at 2^62-1
as per RFC. This is enforced using a budget-based check:

   (v & 127) > (limit - ret) >> shift

This prevents values from  overflowing into the 63rd or 64th bits, which
would otherwise break subsequent signed comparisons (e.g., if (len < name_len))
by interpreting the length as a negative value, leading to false positive
tests.

Thank you to @jming912 for having reported this issue in GH #3302.

Must be backported as far as 2.6

2 weeks agoBUG/MINOR: sock: adjust accept() error messages for ENFILE and ENOMEM
Egor Shestakov [Wed, 25 Feb 2026 16:52:33 +0000 (16:52 +0000)] 
BUG/MINOR: sock: adjust accept() error messages for ENFILE and ENOMEM

In the ENFILE and ENOMEM cases, when accept() fails, an irrelevant
global.maxsock value was printed that doesn't reflect system limits.
Now the actconn is printed that gives a hint about the failure reasons.

Should be backported in all stable branches.

2 weeks agoMINOR: log: support optional 'profile <log_profile_name>' argument to do-log action
Aurelien DARRAGON [Thu, 19 Mar 2026 11:43:00 +0000 (12:43 +0100)] 
MINOR: log: support optional 'profile <log_profile_name>' argument to do-log action

We anticipated that the do-log action should be expanded with optional
arguments at some point. Now that we heard of multiple use-cases
that could be achieved with do-log action, but that are limitated by the
fact that all do-log statements inherit from the implicit log-profile
defined on the logger, we need to provide a way for the user to specify
that custom log-profile that could be used per do-log actions individually

This is what we try to achieve in this commit, by leveraging the
prerequisite work performed by the last 2 commits.