]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: peers: fix an overflow when syncing strings larger than 16 bytes
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2013 14:56:44 +0000 (16:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2013 15:24:54 +0000 (17:24 +0200)
commit9d9179b5818eb6d6eafe2f9880c8a07806c3f77d
tree17a64897012b721e4abe243c9d1f8f4da1c6752d
parenta7b46b50d9bb723f3bd3759c98130fbdd790158b
BUG/MAJOR: peers: fix an overflow when syncing strings larger than 16 bytes

When syncing data between two haproxy instances, the received keys were
allocated in the stack but no room was planned for type string. So in
practice all strings of 16 or less bytes were properly handled (due to
the union with in6_addr which reserves some room), but above this some
local variables were overwritten. Up to 8 additional bytes could be
written without impact, but random behaviours are expected above, including
crashes and memory corruption.

If large enough strings are allowed in the configuration, it is possible that
code execution could be triggered when the function's return pointer is
overwritten.

A quick workaround consists in ensuring that no stick-table uses a string
larger than 16 bytes (default is 32). Another workaround is to disable peer
sync when strings are in use.

Thanks to Will Glass-Husain for bringing up this issue with a backtrace to
understand the issue.

The bug only affects 1.5-dev3 and above. No backport is needed.
src/peers.c