Skip to content

netfilter: handle ipv6 jumbo packets properly for bridge ovs and tc

Xin Long netdev netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyIn review
  2. v16 patches 18 repliesSuperseded

Changes in v2 from the cover letter

- use the proper cast type in Patch 1, as Simon suggested.
- simplify the return path in Patch 2, as Simon suggested.
- move pkt_len definition into a smaller scope in Patch 3, as Simon suggested.
- move err definition into a smaller scope in Patch 5, as Simon suggested.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6netfilter: bridge: call pskb_may_pull in br_nf_check_hbh_lennet/bridge/br_netfilter_ipv6.c+9 -50 replies
2/6netfilter: bridge: check len before accessing more nh datanet/bridge/br_netfilter_ipv6.c+20 -250 replies
3/6netfilter: bridge: move pskb_trim_rcsum out of br_nf_check_hbh_lennet/bridge/br_netfilter_ipv6.c+14 -190 replies
4/6netfilter: move br_nf_check_hbh_len to utilsinclude/linux/netfilter_ipv6.h net/bridge/br_netfilter_ipv6.c net/netfilter/utils.c+55 -540 replies
5/6netfilter: use nf_ip6_check_hbh_len in nf_ct_skb_network_trimnet/netfilter/nf_conntrack_ovs.c+9 -20 replies
6/6selftests: add a selftest for big tcptools/testing/selftests/net/Makefile tools/testing/selftests/net/big_tcp.sh+181 -01 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchSimon HormanNikolay AleksandrovAaron Conole
1/6R-b A-b R-b
2/6R-b A-b R-b
3/6R-b A-b R-b
4/6R-b R-b R-b
5/6R-b R-b R-b
6/6R-b R-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 3 reviewers.

Read the v2 thread

Cover letter [PATCHv2 nf-next 0/6] netfilter: handle ipv6 jumbo packets properly for bridge ovs and tc

Currently pskb_trim_rcsum() is always done on the RX path. However, IPv6 jumbo packets hide the real packet len in the Hop-by-hop option header, which should be parsed before doing the trim.

In ip6_rcv_core() it calls ipv6_parse_hopopts() to handle the Hop-by-hop option header then do pskb_trim_rcsum(). The similar process should also be done properly before pskb_trim_rcsum() on the RX path of bridge and openvswitch and tc.

This patchset improves the function handling the Hop-by-hop option header in bridge, and moves this function into netfilter utils, and then uses it in nf_conntrack_ovs for openvswitch and and tc.

Note that this patch is especially needed after the IPv6 BIG TCP was supported in kernel, which is using IPv6 Jumbo packets, and the last patch adds a big tcp selftest, which also covers it.

v1->v2:
- use the proper cast type in Patch 1, as Simon suggested.
- simplify the return path in Patch 2, as Simon suggested.
- move pkt_len definition into a smaller scope in Patch 3, as Simon suggested.
- move err definition into a smaller scope in Patch 5, as Simon suggested.

Xin Long (6):
netfilter: bridge: call pskb_may_pull in br_nf_check_hbh_len
netfilter: bridge: check len before accessing more nh data
netfilter: bridge: move pskb_trim_rcsum out of br_nf_check_hbh_len
netfilter: move br_nf_check_hbh_len to utils
netfilter: use nf_ip6_check_hbh_len in nf_ct_skb_network_trim
selftests: add a selftest for big tcp

 include/linux/netfilter_ipv6.h         |   2 +
 net/bridge/br_netfilter_ipv6.c         |  79 ++---------
 net/netfilter/nf_conntrack_ovs.c       |  11 +-
 net/netfilter/utils.c                  |  52 +++++++
 tools/testing/selftests/net/Makefile   |   1 +
 tools/testing/selftests/net/big_tcp.sh | 180 +++++++++++++++++++++++++
 6 files changed, 254 insertions(+), 71 deletions(-)
 create mode 100755 tools/testing/selftests/net/big_tcp.sh
Signature · 1 line
2.39.1