summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-07-27 12:08:55 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2018-07-27 12:33:59 +0200
commit792e682a471db356576473d90e9700071171d7e1 (patch)
tree0e5222ffe5173364b7c69c00efdeb50dd10158b3 /tools/lib/bpf/libbpf.c
parent9fa2a49a4ac4f105943fe244b0fa825beb1d1ba5 (diff)
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
[ Upstream commit 3d4bf93ac12003f9b8e1e2de37fe27983deebdcf ] In case an attacker feeds tiny packets completely out of order, tcp_collapse_ofo_queue() might scan the whole rb-tree, performing expensive copies, but not changing socket memory usage at all. 1) Do not attempt to collapse tiny skbs. 2) Add logic to exit early when too many tiny skbs are detected. We prefer not doing aggressive collapsing (which copies packets) for pathological flows, and revert to tcp_prune_ofo_queue() which will be less expensive. In the future, we might add the possibility of terminating flows that are proven to be malicious. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
0 files changed, 0 insertions, 0 deletions