]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: bwlim: fix a stick-table entry leak in shared mode
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 13 Aug 2026 13:57:56 +0000 (15:57 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 13 Aug 2026 13:52:21 +0000 (15:52 +0200)
commit40c627282d800f8686ad6a57baa2707aa3d59ca0
tree9f6ea955a35ea2afc28d1d5b3a8f29dbd28aae00
parent33374957db657c4845153e644c8c2f4279a8724e
BUG/MEDIUM: bwlim: fix a stick-table entry leak in shared mode

In shared mode, bwlim_set_limit() stores the stick-table entry returned
by stktable_get_entry(), which takes a reference, into st->ts without
releasing any entry already stored there. When set-bandwidth-limit is
executed more than once for the same stream and shared filter, the
intermediate reference is leaked: bwlim_detach() only releases the last
one. The entry then stays pinned (ref_cnt > 0) and can never be purged,
and with distinct keys the table fills up until the features depending
on it are denied service.

Release the previously held entry before overwriting st->ts.

This was introduced in 2.7 by commit 2b6777021 ("MEDIUM: bwlim: Add
support of bandwith limitation at the stream level") and must be
backported to all stable branches.

Many thanks to Red Hat and AISLE Research for reporting the issue and
providing a fix.
src/flt_bwlim.c