]> git.kaiwu.me - haproxy.git/commit
MINOR: shctx: clamp shctx_row_data_get() reads against the offset
authorMaxime Henrion <mhenrion@haproxy.com>
Thu, 9 Jul 2026 16:08:33 +0000 (12:08 -0400)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Jul 2026 14:42:35 +0000 (16:42 +0200)
commit0386ec2544d5ce4062158c0d971f8e753080b974
tree568845895956318a2853627ecc482c92d1d174d6
parent6750c36adfc82bb4102a2c7a12b1caa20801c39f
MINOR: shctx: clamp shctx_row_data_get() reads against the offset

The length clamp capped the request to the whole row length but ignored
<offset>, so a read starting past the beginning of the row could run
beyond the stored data and copy stale bytes from the reserved tail of
its blocks. No current caller reads past first->len so this was never
triggered, but the helper is public and its contract does not forbid it.

Clamp against (first->len - offset) instead, returning early when the
offset is already at or past the stored data.

This may be backported along with the shctx_row_data_get() offset fix.
src/shctx.c