diff options
author | David S. Miller <davem@davemloft.net> | 2018-08-06 03:16:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-06 03:16:46 +0300 |
commit | c30f1fc041b74ecdb072dd44f858750414b8b19f (patch) | |
tree | 4ecb0bb64c8baa58162b3f03046c0643a140ece0 /net/ipv6/reassembly.c | |
parent | cfb4099fb4c101dad283a163c9525240ef4a1a99 (diff) | |
parent | fa0f527358bd900ef92f925878ed6bfbd51305cc (diff) | |
download | linux-c30f1fc041b74ecdb072dd44f858750414b8b19f.tar.xz |
Merge branch 'ip-Use-rb-trees-for-IP-frag-queue'
Peter Oskolkov says:
====================
ip: Use rb trees for IP frag queue.
This patchset
* changes IPv4 defrag behavior to match that of IPv6: overlapping
fragments now cause the whole IP datagram to be discarded (suggested
by David Miller): there are no legitimate use cases for overlapping
fragments;
* changes IPv4 defrag queue from a list to a rb tree (suggested
by Eric Dumazet): this change removes a potential attach vector.
Upcoming patches will contain similar changes for IPv6 frag queue,
as well as a comprehensive IP defrag self-test (temporarily delayed).
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 6edd2ac8ae4b..b4e558ab39fa 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -405,6 +405,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, __IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); rcu_read_unlock(); fq->q.fragments = NULL; + fq->q.rb_fragments = RB_ROOT; fq->q.fragments_tail = NULL; return 1; |