]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stick-tables: Always return the good stksess from stktable_set_entry
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Nov 2025 10:31:45 +0000 (11:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Nov 2025 10:56:12 +0000 (11:56 +0100)
commitbd4fff9a767945be278d84cc98dcbe2245652b59
tree1e4e9b4dada4c5cdc9992153ca900bc01a273c8d
parentbf639e581dff40331a8549f401d9a206f5e05fac
BUG/MEDIUM: stick-tables: Always return the good stksess from stktable_set_entry

In stktable_set_entry(), the return value of __stktable_store() is not
tested while it is possible to get an existing session with the same key
instead of the one we want to insert. It happens when we fails to upgrade
the read lock on the bucket to an write lock. In that case, we release the
lock for a short time to get a write lock.

So, to fix the bug, we must check the session returned by __stktable_store()
and take care to return this one.

The bug was introduced by the commit e62885237c ("MEDIUM: stick-table: make
stktable_set_entry() look up under a read lock"). It must be backported as
far as 2.8.
src/stick_table.c