lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240725-udp-gso-egress-from-tunnel-v1-2-5e5530ead524@cloudflare.com>
Date: Thu, 25 Jul 2024 11:55:55 +0200
From: Jakub Sitnicki <jakub@...udflare.com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>, 
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
 Paolo Abeni <pabeni@...hat.com>, Willem de Bruijn <willemb@...gle.com>, 
 kernel-team@...udflare.com
Subject: [PATCH net 2/2] selftests/net: Add coverage for UDP GSO with
 egress from tunnel

After enabling UDP GSO for devices not offering checksum offload, we have
hit a regression where a bad offload warning can be triggered if egressing
through a tunnel device.

This can happen when the tunnel device has checksum offload disabled or
when IPv6 extension headers are present.

Extend the UDP GSO tests to cover the egress from a tunnel device scenario.

Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
---
 tools/testing/selftests/net/udpgso.sh | 41 ++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/net/udpgso.sh b/tools/testing/selftests/net/udpgso.sh
index 85d1fa3c1ff7..3fb6fea06b28 100755
--- a/tools/testing/selftests/net/udpgso.sh
+++ b/tools/testing/selftests/net/udpgso.sh
@@ -28,9 +28,13 @@ test_route_mtu() {
 }
 
 setup_dummy_sink() {
-	ip link add name sink mtu 1500 type dummy
-	ip addr add dev sink 10.0.0.0/24
-	ip addr add dev sink fd00::2/64 nodad
+	mtu="${1:-1500}"
+	prefix4="${2:-10.0.0.2/24}"
+	prefix6="${3:-fd00::2/48}"
+
+	ip link add name sink mtu "${mtu}" type dummy
+	ip addr add dev sink "${prefix4}"
+	ip addr add dev sink "${prefix6}" nodad
 	ip link set dev sink up
 }
 
@@ -52,6 +56,25 @@ test_sw_gso_sw_csum() {
 	ethtool -K sink tx-udp-segmentation off >/dev/null
 }
 
+setup_ipip_tunnel() {
+	setup_dummy_sink 1520 10.1.1.2/24 fd11::2/48
+
+	ip tunnel add iptnl mode ipip local 10.1.1.2 remote 10.1.1.1
+	ip addr add dev iptnl 10.0.0.2/24
+	ip addr add dev iptnl fd00::2/48 nodad
+	ip link set dev iptnl up
+}
+
+test_tunnel_hw_csum() {
+	setup_ipip_tunnel
+	ethtool -K iptnl tx-checksum-ip-generic on >/dev/null
+}
+
+test_tunnel_sw_csum() {
+	setup_ipip_tunnel
+	ethtool -K iptnl tx-checksum-ip-generic off >/dev/null
+}
+
 if [ "$#" -gt 0 ]; then
 	"$1"
 	shift 2 # pop "test_*" arg and "--" delimiter
@@ -99,3 +122,15 @@ echo "ipv4 sw-gso sw-csum"
 
 echo "ipv6 sw-gso sw-csum"
 ./in_netns.sh "$0" test_sw_gso_sw_csum -- ./udpgso -6 -C -R
+
+echo "ipv4 tunnel hw-csum"
+./in_netns.sh "$0" test_tunnel_hw_csum -- ./udpgso -4 -C -R
+
+echo "ipv6 tunnel hw-csum"
+./in_netns.sh "$0" test_tunnel_hw_csum -- ./udpgso -6 -C -R
+
+echo "ipv4 tunnel sw-csum"
+./in_netns.sh "$0" test_tunnel_sw_csum -- ./udpgso -4 -C -R
+
+echo "ipv6 tunnel sw-csum"
+./in_netns.sh "$0" test_tunnel_sw_csum -- ./udpgso -6 -C -R

-- 
2.40.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ