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]
Date:	Mon, 16 May 2016 15:33:35 -0700
From:	Dimitris Michailidis <dmichail@...gle.com>
To:	netdev@...r.kernel.org
Cc:	edumazet@...gle.com
Subject: [PATCH] net: don't lose features in netdev_add_tso_features()

The goal of netdev_add_tso_features() is to enable all TSO features but
it unintentionally loses NETIF_F_ALL_FOR_ALL features. This is because
the netdev_increment_features() it calls clears any NETIF_F_ALL_FOR_ALL
bits that aren't included in the incremental features and none of them
are included in NETIF_F_ALL_TSO. The behavior can be seen by enabling
tx-nocache-copy on the slaves and noticing the feature remains off at
the master.

Fix this by including NETIF_F_ALL_FOR_ALL in the incremental features.

Signed-off-by: Dave Platt <dplatt@...gle.com>
Signed-off-by: Dimitris Michailidis <dmichail@...gle.com>
---
 include/linux/netdevice.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c2f5112..da45388 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3978,7 +3978,12 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
 static inline netdev_features_t netdev_add_tso_features(netdev_features_t features,
 							netdev_features_t mask)
 {
-	return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+	/* OR in NETIF_F_ALL_FOR_ALL to preserve any of its bits already present
+	 * in features
+	 */
+	return netdev_increment_features(features,
+					 NETIF_F_ALL_TSO | NETIF_F_ALL_FOR_ALL,
+					 mask);
 }
 
 int __netdev_update_features(struct net_device *dev);
-- 
2.8.0.rc3.226.g39d4020

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ