]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stick-table: fix crash for src_inc_gpc() without stkcounter
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Jul 2024 12:48:55 +0000 (14:48 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Jul 2024 14:12:36 +0000 (16:12 +0200)
commitea7ea5198a0ed9352f88425c884e6437ecc9ebdc
tree656880e807786700935cb68ed5228321bee68a6a
parent2bd269cf2a1345a48e5398149d3ead04ff059266
BUG/MINOR: stick-table: fix crash for src_inc_gpc() without stkcounter

Since 2.5, an array of GPC is provided to replace legacy gpc0/gpc1.
src_inc_gpc is a sample fetch which is used to increment counters in
this array.

A crash occurs if src_inc_gpc is used without any previous track-sc
rule. This is caused by an error in smp_fetch_sc_inc_gpc(). When
temporary stick counter is created via smp_create_src_stkctr(), table
pointer arg value used is not correct : it points to the counter ID
instead of the table argument. To fix this, use the proper sample fetch
second arg.

This can be reproduced with the following config :
  acl mark src_inc_gpc(0,<table>) -m bool
  tcp-request connection accept if mark

This should be backported up to 2.6.
src/stick_table.c