]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: Stick-tables crash with segfault when the key is not in the stick-table
authorThierry FOURNIER <thierry.fournier@ozon.io>
Mon, 25 Jun 2018 20:35:20 +0000 (22:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Jun 2018 11:51:46 +0000 (13:51 +0200)
commitac1f3ed64b58bd178865c6f2cc8f6f306d9e1e15
tree15d7e112063979607ba0d60e0bd1fe0ba0f4f025
parent26ac8a6c4ed47dbf5d773d59ef09880eaabec8ab
BUG/MAJOR: Stick-tables crash with segfault when the key is not in the stick-table

When a lookup is done on a key not present in the stick-table the "st"
pointer is NULL and it is used to return the converter result, but it
is used untested with stktable_release().

This regression was introduced in 1.8.10 here:

   BUG/MEDIUM: stick-tables: Decrement ref_cnt in table_* converters
   commit d7bd88009d88dd413e01bc0baa90d6662a3d7718
   Author: Daniel Corbett <dcorbett@haproxy.com>
   Date:   Sun May 27 09:47:12 2018 -0400

Minimal conf for reproducong the problem:

   frontend test
      mode http
      stick-table type ip size 1m expire 1h store gpc0
      bind *:8080
      http-request redirect location /a if { src,in_table(test) }

The segfault is triggered using:

   curl -i http://127.0.0.1:8080/

This patch must be backported in 1.8
src/stick_table.c