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: <1420007736-30822-1-git-send-email-Yuval.Mintz@qlogic.com>
Date:	Wed, 31 Dec 2014 08:35:36 +0200
From:	Yuval Mintz <Yuval.Mintz@...gic.com>
To:	<davem@...emloft.net>
CC:	<netdev@...r.kernel.org>, Yuval Mintz <Yuval.Mintz@...gic.com>
Subject: [PATCH net-next] net: More vlan tests before registering netdevice

When register_netdevice() is called, netdevice's vlan filtering feature
and supplied callbacks are checked to see the vlan implementation is
not buggy.
This adds an additional test - see that the vlan_features were filled
correctly, as the vlan devices inherits those as its own features;
Incorrect values set there would later prevent the vlan interface from being
registered itself [as it doesn't implement the filtering ndos].

Signed-off-by: Yuval Mintz <Yuval.Mintz@...gic.com>
---
Hi Dave,

Not sure why take such a defensive approach regarding this feature.
Perhaps it would have been better to simply remove these checks altogether.

Cheers,
Yuval
---

 net/core/dev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 3f191da..8a663b2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6253,10 +6253,11 @@ int register_netdevice(struct net_device *dev)
 		}
 	}
 
-	if (((dev->hw_features | dev->features) &
-	     NETIF_F_HW_VLAN_CTAG_FILTER) &&
-	    (!dev->netdev_ops->ndo_vlan_rx_add_vid ||
-	     !dev->netdev_ops->ndo_vlan_rx_kill_vid)) {
+	if ((((dev->hw_features | dev->features) &
+	      NETIF_F_HW_VLAN_CTAG_FILTER) &&
+	     (!dev->netdev_ops->ndo_vlan_rx_add_vid ||
+	      !dev->netdev_ops->ndo_vlan_rx_kill_vid)) ||
+	    (dev->vlan_features & NETIF_F_HW_VLAN_CTAG_FILTER) {
 		netdev_WARN(dev, "Buggy VLAN acceleration in driver!\n");
 		ret = -EINVAL;
 		goto err_uninit;
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ