From: Xin Long <lucien.xin@gmail.com>
To: netfilter-devel@vger.kernel.org, network dev <netdev@vger.kernel.org>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@netfilter.org>,
Florian Westphal <fw@strlen.de>,
davem@davemloft.net, kuba@kernel.org,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Roopa Prabhu <roopa@nvidia.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
Pravin B Shelar <pshelar@ovn.org>,
Aaron Conole <aconole@redhat.com>,
Simon Horman <simon.horman@corigine.com>
Subject: [PATCHv2 nf-next 0/6] netfilter: handle ipv6 jumbo packets properly for bridge ovs and tc
Date: Tue, 7 Mar 2023 16:31:26 -0500 [thread overview]
Message-ID: <cover.1678224658.git.lucien.xin@gmail.com> (raw)
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
--
2.39.1
next reply other threads:[~2023-03-07 21:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 21:31 Xin Long [this message]
2023-03-07 21:31 ` [PATCHv2 nf-next 1/6] netfilter: bridge: call pskb_may_pull in br_nf_check_hbh_len Xin Long
2023-03-07 21:31 ` [PATCHv2 nf-next 2/6] netfilter: bridge: check len before accessing more nh data Xin Long
2023-03-07 21:31 ` [PATCHv2 nf-next 3/6] netfilter: bridge: move pskb_trim_rcsum out of br_nf_check_hbh_len Xin Long
2023-03-07 21:31 ` [PATCHv2 nf-next 4/6] netfilter: move br_nf_check_hbh_len to utils Xin Long
2023-03-07 21:31 ` [PATCHv2 nf-next 5/6] netfilter: use nf_ip6_check_hbh_len in nf_ct_skb_network_trim Xin Long
2023-03-07 21:31 ` [PATCHv2 nf-next 6/6] selftests: add a selftest for big tcp Xin Long
2023-03-08 11:10 ` Nikolay Aleksandrov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1678224658.git.lucien.xin@gmail.com \
--to=lucien.xin@gmail.com \
--cc=aconole@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=pshelar@ovn.org \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.com \
--cc=simon.horman@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).