BUG/MEDIUM: filters: Handle filters registered on data with no payload callback
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Feb 2025 14:54:49 +0000 (15:54 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 14:48:55 +0000 (15:48 +0100)
commit5da93f35ea6b55d639d276a78af4432a2ad825bf
tree9bfd23774c1f02a9bc2d0ac2670e666af9c5f673
parent737795c1b2f071c695f3d6fbf04cdf52d120abad
BUG/MEDIUM: filters: Handle filters registered on data with no payload callback

An HTTP filter with no http_payload callback function may be registered on
data. In that case, this filter is obviously not called when some data are
received but it remains important to update its internal state to be sure to
keep it synchronized on the stream, especially its offet value. Otherwise,
the wrong calculation on the global offset may be performed in
flt_http_end(), leading to an integer overflow when data are moved from
input to output. This overflow triggers a BUG_ON() in c_adv().

The same is true for TCP filters with no tcp_payload callback function.

This patch must be backport to all stable versions.

(cherry picked from commit 34542d5ec29c89ec45b63107f9330f185f0bfd40)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 6633abae2a17f969754504f2aca37bbfa12f3ca4)
[ad: remove reference to non existant members in 3.0]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
src/filters.c