]> git.ipfire.org Git - thirdparty/suricata.git/commit
proto detect: add cutoff for unbalanced traffic
authorVictor Julien <victor@inliniac.net>
Wed, 22 Jan 2014 18:06:31 +0000 (19:06 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 22 Apr 2014 08:19:42 +0000 (10:19 +0200)
commit32aafa6a485ceeac5eb7773dcbbc932837bbca80
treeec5332d9866c0e722a1e81a2389b93b4f9d0081c
parent44b8be3732b44f0d6d6ed807add7d78a556102c2
proto detect: add cutoff for unbalanced traffic

If we're getting a lot of data in one direction and the proto for this
direction is unknown, proto detect will hold up segments in the segment
list in the stream. They are held so that if we detect the protocol on
the opposing stream, we can still parse this side of the stream as well.
However, some sessions are very unbalanced. FTP data channels, large
PUT/POST request and many others, can lead to cases where we would have
to store many megabytes worth of segments before we see the opposing
stream. This leads to risks of resource starvation.

In this patch, a cutoff point is enforced. If we've stored 100k in one
direction and we've seen no data in the other direction, we give up.

If we've given up, the applayer_proto_detection_skipped event is set.
    app-layer-event: applayer_proto_detection_skipped;
src/app-layer.c