haproxy/ebtree
Willy Tarreau 007257ebab BUG: ebtree: ebst_lookup() could return the wrong entry
(from ebtree 6.0.7)

Julien Thomas provided a reproducible test case where a string lookup
could return the wrong node. The issue is caused by the jump to a node
which contains less bit in common than the previous node, making the
string_equal_bits() function return -1. We must not remember more bits
than the number on the node, otherwise we can be tempted to trust them
while they can change while running down.

For a valid test case, enter : "0", "WW", "W", "S", and lookup "W".
Previously, "S" was returned.

Note: string-based ebtrees are used in haproxy in ACL, peers and
stick-tables. ACLs are not affected because all patterns are
interchangeable. stick-tables are not affected because lookups are
performed using ebmb_lookup(). Only peers might be affected though
it is not easy to infirm or confirm the issue.

(cherry picked from commit dd47a54103597458887d3cc8414853a541aee9c1)
2011-12-02 17:09:50 +01:00
..
LICENSE CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
compiler.h [BUG] definitely fix regparm issues between haproxy core and ebtree 2009-10-27 21:53:58 +01:00
eb32tree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
eb32tree.h CLEANUP: ebtree: remove another typo, a wrong initialization in insertion code 2011-12-02 17:09:50 +01:00
eb64tree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
eb64tree.h CLEANUP: ebtree: remove another typo, a wrong initialization in insertion code 2011-12-02 17:09:50 +01:00
ebimtree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebimtree.h CLEANUP: ebtree: remove another typo, a wrong initialization in insertion code 2011-12-02 17:09:50 +01:00
ebistree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebistree.h BUG: ebtree: ebst_lookup() could return the wrong entry 2011-12-02 17:09:50 +01:00
ebmbtree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebmbtree.h CLEANUP: ebtree: remove another typo, a wrong initialization in insertion code 2011-12-02 17:09:50 +01:00
ebpttree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebpttree.h CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebsttree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebsttree.h BUG: ebtree: ebst_lookup() could return the wrong entry 2011-12-02 17:09:50 +01:00
ebtree.c CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
ebtree.h CLEANUP: ebtree: remove 4-year old harmless typo in duplicates insertion code 2011-12-02 17:09:50 +01:00