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: <4C2B0614.9040004@redhat.com>
Date:	Wed, 30 Jun 2010 10:53:40 +0200
From:	Stefan Assmann <sassmann@...hat.com>
To:	netdev <netdev@...r.kernel.org>
CC:	e1000-devel@...ts.sourceforge.net,
	"Duyck, Alexander H" <alexander.h.duyck@...el.com>,
	gregory.v.rose@...el.com, jeffrey.t.kirsher@...el.com,
	Andy Gospodarek <gospo@...hat.com>
Subject: [PATCH] igbvf: avoid name clash between PF and VF

From: Stefan Assmann <sassmann@...hat.com>

It looks like the VFs get initialized before all the PFs are. Therefore
the udev mapping MAC <-> ethX (for PFs) gets screwed because the VFs
may grab the ethX interface names (reserved by udev) for the PFs.

Example:
igb max_vfs=0
eth0      Link encap:Ethernet  HWaddr 00:13:20:F7:A5:9E
eth1      Link encap:Ethernet  HWaddr 00:13:20:F7:A5:9F
eth2      Link encap:Ethernet  HWaddr 00:13:20:F7:A5:A0
eth3      Link encap:Ethernet  HWaddr 00:13:20:F7:A5:A1
igb max_vfs=1
eth0      Link encap:Ethernet  HWaddr 00:13:20:F7:A5:9E
eth1      Link encap:Ethernet  HWaddr 0A:CF:41:69:F7:A9
eth2      Link encap:Ethernet  HWaddr 3A:FE:20:4C:2A:3B
eth3      Link encap:Ethernet  HWaddr C6:C3:B1:56:C9:A4
eth3_rename Link encap:Ethernet  HWaddr 00:13:20:F7:A5:9F
eth4      Link encap:Ethernet  HWaddr 6E:8A:8A:A3:5F:69
eth4_rename Link encap:Ethernet  HWaddr 00:13:20:F7:A5:A0
eth5_rename Link encap:Ethernet  HWaddr 00:13:20:F7:A5:A1

In the example above VF 0A:CF:41:69:F7:A9 grabs eth1 but udev
has a rule that says eth1 should be assigned PF 00:13:20:F7:A5:9F
(eth3_rename) and waits for the VF to disappear to rename eth3_rename
to eth1. Unfortunately eth1 is not going to disappear.
This is not a udev bug since udev doesn't create persistent rules for
VFs as their MAC address changes every reboot.

To avoid this problem we could change the kernel name for the VFs and
thus avoid confusion between VFs and PFs.

I've already discussed this with Alexander Duyck and Greg Rose, so far
they have no objection. However this problem appears for all drivers that
support PFs and VFs and thus the changes should be applied consistently
to all of these drivers.

Signed-off-by: Stefan Assmann <sassmann@...hat.com>
---
 drivers/net/igbvf/netdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 5e2b2a8..2fb665b 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2787,7 +2787,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
 	netif_carrier_off(netdev);
 	netif_stop_queue(netdev);

-	strcpy(netdev->name, "eth%d");
+	strcpy(netdev->name, "veth%d");
 	err = register_netdev(netdev);
 	if (err)
 		goto err_hw_init;
-- 
1.6.5.2

--
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