]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: proxy: Perform a custom copy for default server settings
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Aug 2022 09:31:55 +0000 (11:31 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Aug 2022 09:44:34 +0000 (11:44 +0200)
commit6bb86539dbe66b79e011b287c8b750f2e4ee62a0
treea38b07f7a61d81c8ec1daac7009aef8b1868b57d
parentb32cb9b5151d4b42ff92edd707d61960f8b3a536
BUG/MEDIUM: proxy: Perform a custom copy for default server settings

When a proxy is initialized with the settings of the default proxy, instead
of doing a raw copy of the default server settings, a custom copy is now
performed by calling srv_settings_copy(). This way, all settings will be
really duplicated. Without this deep copy, some pointers are shared between
several servers, leading to UAF, double-free or such bugs.

This patch relies on following commits:

  * b32cb9b51 REORG: server: Export srv_settings_cpy() function
  * 0b365e3cb MINOR: server: Constify source server to copy its settings

This patch should fix the issue #1804. It must be backported as far as 2.0.
src/proxy.c