Skip to content

backport of IP fragmentation fixes

Stephen Hemminger linux-wpan netdev netfilter-devel stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest30 patches 14 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30inet: frags: change inet_frags_init_net() return valueinclude/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/ip_fragment.c +2 more+37 -120 replies
2/30inet: frags: add a pointer to struct netns_fragsinclude/net/inet_frag.h include/net/ipv6.h net/ieee802154/6lowpan/reassembly.c +4 more+48 -410 replies
3/30inet: frags: refactor ipfrag_init()net/ipv4/ip_fragment.c+2 -20 replies
4/30inet: frags: Convert timers to use timer_setup()include/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/inet_fragment.c +3 more+15 -110 replies
5/30inet: frags: refactor ipv6_frag_init()net/ipv6/reassembly.c+14 -110 replies
6/30inet: frags: refactor lowpan_net_frag_init()net/ieee802154/6lowpan/reassembly.c+11 -90 replies
7/30ipv6: export ip6 fragments sysctl to unprivileged usersnet/ipv6/reassembly.c+0 -40 replies
8/30rhashtable: add schedule pointslib/rhashtable.c+2 -00 replies
9/30inet: frags: use rhashtables for reassembly unitsDocumentation/networking/ip-sysctl.txt include/net/inet_frag.h include/net/ipv6.h +6 more+266 -5740 replies
10/30inet: frags: remove some helpersinclude/net/inet_frag.h include/net/ip.h include/net/ipv6.h +3 more+6 -230 replies
11/30inet: frags: get rif of inet_frag_evicting()include/net/inet_frag.h net/ipv4/ip_fragment.c net/ipv6/reassembly.c+32 -420 replies
12/30inet: frags: remove inet_frag_maybe_warn_overflow()include/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/inet_fragment.c +3 more+8 -250 replies
13/30inet: frags: break the 2GB limit for frags storageDocumentation/networking/ip-sysctl.txt include/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c +5 more+32 -320 replies
14/30inet: frags: do not clone skb in ip_expire()net/ipv4/ip_fragment.c+6 -100 replies
15/30ipv6: frags: rewrite ip6_expire_frag_queue()net/ipv6/reassembly.c+16 -80 replies
16/30rhashtable: reorganize struct rhashtable layoutinclude/linux/rhashtable.h+4 -40 replies
17/30inet: frags: reorganize struct netns_fragsinclude/net/inet_frag.h+5 -40 replies
18/30inet: frags: get rid of ipfrag_skb_cb/FRAG_CBinclude/linux/skbuff.h net/ipv4/ip_fragment.c+15 -210 replies
19/30inet: frags: fix ip6frag_low_thresh boundarynet/ieee802154/6lowpan/reassembly.c net/ipv4/ip_fragment.c net/ipv6/netfilter/nf_conntrack_reasm.c +1 more+3 -100 replies
20/30ip: discard IPv4 datagrams with overlapping segments.include/uapi/linux/snmp.h net/ipv4/ip_fragment.c net/ipv4/proc.c+21 -560 replies
21/30net: speed up skb_rbtree_purge()net/core/skbuff.c+7 -40 replies
22/30net: modify skb_rbtree_purge to return the truesize of all purged skbs.include/linux/skbuff.h net/core/skbuff.c+6 -20 replies
23/30ipv6: defrag: drop non-last frags smaller than min mtunet/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/reassembly.c+8 -012 replies
24/30net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friendsinclude/linux/skbuff.h net/core/skbuff.c+16 -30 replies
25/30net: add rb_to_skb() and other rb tree helpersinclude/linux/skbuff.h net/ipv4/tcp_fastopen.c net/ipv4/tcp_input.c +1 more+37 -360 replies
26/30net: sk_buff rbnode reorginclude/linux/skbuff.h include/net/inet_frag.h net/ipv4/inet_fragment.c +3 more+129 -981 reply
27/30ipv4: frags: precedence bug in ip_expire()net/ipv4/ip_fragment.c+1 -10 replies
28/30ip: add helpers to process in-order fragments faster.include/net/inet_frag.h net/ipv4/ip_fragment.c+79 -00 replies
29/30ip: process in-order fragments efficientlynet/ipv4/inet_fragment.c net/ipv4/ip_fragment.c+70 -420 replies
30/30ip: frags: fix crash in ip_do_fragment()net/ipv4/ip_fragment.c net/ipv6/netfilter/nf_conntrack_reasm.c+2 -00 replies

Reviews trailers per patch

5 of 30 patches have a Reviewed-by or Acked-by.

PatchStefan SchmidtHerbert XuStephen HemmingerSoheil Hassas YeganehEric Dumazet
1/30
2/30
3/30
4/30A-b
5/30
6/30
7/30
8/30A-b
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30A-b
21/30
22/30
23/30
24/30
25/30
26/30A-b
27/30
28/30
29/30
30/30R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/30] backport of IP fragmentation fixes

Took the set of patches from 4.19 to handle IP fragmentation DoS and applied them against 4.14.69. Most of these are from Eric. In a couple case, it required some manual merge conflict resolution.

Tested normal IP fragmentation with iperf3 and malicious IP fragments with fragmentsmack. Under fragmentation attack (700Kpps) the original 4.14.69 consumes 97% CPU; with this patch it drops to 5%.

v3 - send to wider audience
v2 - added patch from 4.19 linux-next to fix ip fragmentation crash

Dan Carpenter (1):
ipv4: frags: precedence bug in ip_expire()

Eric Dumazet (22):
inet: frags: change inet_frags_init_net() return value
inet: frags: add a pointer to struct netns_frags
inet: frags: refactor ipfrag_init()
inet: frags: refactor ipv6_frag_init()
inet: frags: refactor lowpan_net_frag_init()
ipv6: export ip6 fragments sysctl to unprivileged users
rhashtable: add schedule points
inet: frags: use rhashtables for reassembly units
inet: frags: remove some helpers
inet: frags: get rif of inet_frag_evicting()
inet: frags: remove inet_frag_maybe_warn_overflow()
inet: frags: break the 2GB limit for frags storage
inet: frags: do not clone skb in ip_expire()
ipv6: frags: rewrite ip6_expire_frag_queue()
rhashtable: reorganize struct rhashtable layout
inet: frags: reorganize struct netns_frags
inet: frags: get rid of ipfrag_skb_cb/FRAG_CB
inet: frags: fix ip6frag_low_thresh boundary
net: speed up skb_rbtree_purge()
net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends
net: add rb_to_skb() and other rb tree helpers
net: sk_buff rbnode reorg

Florian Westphal (1):
ipv6: defrag: drop non-last frags smaller than min mtu

Kees Cook (1):
inet: frags: Convert timers to use timer_setup()

Peter Oskolkov (4):
ip: discard IPv4 datagrams with overlapping segments.
net: modify skb_rbtree_purge to return the truesize of all purged
skbs.
ip: add helpers to process in-order fragments faster.
ip: process in-order fragments efficiently

Taehee Yoo (1):
ip: frags: fix crash in ip_do_fragment()

 Documentation/networking/ip-sysctl.txt  |  13 +-
 include/linux/rhashtable.h              |   8 +-
 include/linux/skbuff.h                  |  50 +-
 include/net/inet_frag.h                 | 135 +++---
 include/net/ip.h                        |   1 -
 include/net/ipv6.h                      |  26 +-
 include/uapi/linux/snmp.h               |   1 +
 lib/rhashtable.c                        |   2 +
 net/core/skbuff.c                       |  31 +-
 net/ieee802154/6lowpan/6lowpan_i.h      |  26 +-
 net/ieee802154/6lowpan/reassembly.c     | 153 ++++---
 net/ipv4/inet_fragment.c                | 378 ++++------------
 net/ipv4/ip_fragment.c                  | 578 +++++++++++++-----------
 net/ipv4/proc.c                         |   7 +-
 net/ipv4/tcp_fastopen.c                 |   8 +-
 net/ipv4/tcp_input.c                    |  33 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c | 105 ++---
 net/ipv6/proc.c                         |   5 +-
 net/ipv6/reassembly.c                   | 217 ++++-----
 net/sched/sch_netem.c                   |  14 +-
 20 files changed, 802 insertions(+), 989 deletions(-)
Signature · 1 line
2.18.0