]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: ssl: fix a double-free of the .sctl buffer with several contexts
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 27 Oct 2026 14:32:47 +0000 (14:32 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 28 Oct 2026 13:55:51 +0000 (14:55 +0100)
commit5a3a2c9be490d3891c7684b0e4bf37b351541ba7
treee6f4464820fbfed6b2f01c1a3ce7d851c1ca49c3
parent67e01b4a90dc0c9d63d70126d8221ebafbe5a87c
BUG/MINOR: ssl: fix a double-free of the .sctl buffer with several contexts

ssl_sock_load_sctl() stores the ckch's .sctl buffer in SSL_CTX ex_data,
whose free callback releases it when the context is destroyed. The ckch
also frees this buffer, causing a double-free during deinit or "haproxy -c",
even with a single bind and certificate. Sharing the certificate across
contexts adds further frees of the same buffer.

Give each context its own copy, leaving the original owned by the ckch.
AWS-LC already copies the list through its native API.

This bug was introduced in 2.1 by commit 0dfae6c315 ("MINOR: ssl: load sctl
from buf OR from a file") and must be backported to all versions since then.
src/ssl_sock.c