]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
inet: frags: do not clone skb in ip_expire()
authorEric Dumazet <edumazet@google.com>
Thu, 13 Sep 2018 14:58:46 +0000 (07:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:43:46 +0000 (22:43 +0200)
commit085a0147447a4f82138825b6a3a329b997c2fb13
treebbb9c03726df6f803fccbc4ee6d36cd65e03e889
parent990204ddc5f67530b2ac616767a5c6937c9fc2af
inet: frags: do not clone skb in ip_expire()

An skb_clone() was added in commit ec4fbd64751d ("inet: frag: release
spinlock before calling icmp_send()")

While fixing the bug at that time, it also added a very high cost
for DDOS frags, as the ICMP rate limit is applied after this
expensive operation (skb_clone() + consume_skb(), implying memory
allocations, copy, and freeing)

We can use skb_get(head) here, all we want is to make sure skb wont
be freed by another cpu.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1eec5d5670084ee644597bd26c25e22c69b9f748)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ip_fragment.c