]> git.ipfire.org Git - thirdparty/suricata.git/commit
stream/sack: turn SACK record list into rbtree
authorVictor Julien <victor@inliniac.net>
Sun, 26 Aug 2018 08:14:18 +0000 (10:14 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 17 Sep 2018 06:27:24 +0000 (08:27 +0200)
commit7ec7d234ccca638ca4915ef849777c2cdf923471
treeb73ba4a98323c4e0d4da5c507cbf16e8c659dbeb
parent51ce03e76a1b848e97cb37ac8ae789de8318f8df
stream/sack: turn SACK record list into rbtree

Convert to rbtree from linked list. These ranges, of which there can
be multiple per packet, are fully controlled by an attacked. The
attacker could craft a stream of packet in such a way that the list
would grow very large. This would make inserts/removals very expensive,
as well as the list walk that is done and size calculation and pruning
operations.

The RBTREE makes inserts/removals much cheaper, at a slight overhead
for 'normal' operations and slightly higher per record memory use.
src/stream-tcp-private.h
src/stream-tcp-sack.c
src/stream-tcp-sack.h