]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: server: fix crash after duplicate GUID insertion
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 May 2025 15:48:58 +0000 (17:48 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 May 2025 15:59:37 +0000 (17:59 +0200)
commitb40ce97ecca0e43c45f6a15e3a7184436d5cb467
treec2f14527d29ae5c3f8d1e99e7ff6bb5a1d5e413a
parent5e088e3f8ec2a93b33b4e412530b4321f16bd8de
BUG/MEDIUM: server: fix crash after duplicate GUID insertion

On "add server", if a GUID is defined, guid_insert() is used to add the
entry into the global GUID tree. If a similar entry already exists, GUID
insertion fails and the server creation is eventually aborted.

A crash could occur in this case because of an invalid memory access via
guid_remove(). The latter is caused via free_server() as the server
insertion is rejected. The invalid occurs on GUID key.

The issue occurs because of guid_insert(). The function properly
deallocates the GUID key on duplicate insertion, but it failed to reset
<guid.node.key> to NULL. This caused the invalid memory access on
guid_remove(). To fix this, ensure that key member is properly resetted
on guid_insert() error path.

This must be backported up to 3.0.
src/guid.c