]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: session: ensure conn owner is set after insert into session
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 Mar 2024 10:25:31 +0000 (11:25 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 Mar 2024 13:26:57 +0000 (14:26 +0100)
commitc130f74803bc8bb40a748f734b7e150b3a23daa7
treece1db8312b9be5d7cded1cc6ac732245a36c3681
parenteb89e4f3e0595abdd38694b01209d6a69787f8cf
BUG/MINOR: session: ensure conn owner is set after insert into session

A crash could occured if a session_add_conn() would temporarily failed
when called via h2_detach(). In this case, connection owner is reset to
NULL. However, if this wasn't the last connection stream, the connection
won't be destroyed. When h2_detach() is recalled for another stream and
this time session_add_conn() succeeds, a crash will occur due to
session_check_idle_conn() invocation with a NULL connection owner.

To fix this, ensure connection owner is always set after
session_add_conn() success.

This bug is considered as minor as the only failure reason for
session_add_conn() is a pool allocation issue.

This should be backported up to all stable releases.
include/haproxy/session.h