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-next>] [day] [month] [year] [list]
Message-ID: <20250312115400.773516-1-rakesh.radharapu@amd.com>
Date: Wed, 12 Mar 2025 17:24:00 +0530
From: Radharapu Rakesh <rakesh.radharapu@....com>
To: <git@....com>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <horms@...nel.org>,
	<kuniyu@...zon.com>, <bigeasy@...utronix.de>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<rakesh.radharapu@....com>, <harini.katakam@....com>,
	<radhey.shyam.pandey@....com>, <michal.simek@....com>
Subject: [RFC PATCH net-next] net: Modify CSUM capability check for USO

Some devices supporting USO have only ipv4 checksum enabled,
but USO gets disabled because both ipv4 and ipv6 functionality is checked.

IPv4 or IPv6 or both checksums, can be utilized with UDP segmentation
offload. Separate checks for both IPv4 and IPv6 checksums.

Fixes: 2b2bc3bab158 ("net: Make USO depend on CSUM offload")
Signed-off-by: Radharapu Rakesh <rakesh.radharapu@....com>
---
 net/core/dev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1cb134ff7327..a22f8f6e2ed1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10465,11 +10465,13 @@ static void netdev_sync_lower_features(struct net_device *upper,
 
 static bool netdev_has_ip_or_hw_csum(netdev_features_t features)
 {
-	netdev_features_t ip_csum_mask = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-	bool ip_csum = (features & ip_csum_mask) == ip_csum_mask;
+	netdev_features_t ipv4_csum_mask = NETIF_F_IP_CSUM;
+	netdev_features_t ipv6_csum_mask = NETIF_F_IPV6_CSUM;
+	bool ipv4_csum = (features & ipv4_csum_mask) == ipv4_csum_mask;
+	bool ipv6_csum = (features & ipv6_csum_mask) == ipv6_csum_mask;
 	bool hw_csum = features & NETIF_F_HW_CSUM;
 
-	return ip_csum || hw_csum;
+	return ipv4_csum || ipv6_csum || hw_csum;
 }
 
 static netdev_features_t netdev_fix_features(struct net_device *dev,
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ