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:	Thu, 2 Jan 2014 14:32:32 +0800
From:	jiang.biao2@....com.cn
To:	Manish Chopra <manish.chopra@...gic.com>,
	Sony Chacko <sony.chacko@...gic.com>,
	Rajesh Borundia <rajesh.borundia@...gic.com>
Cc:	netdev@...r.kernel.org, li.fengmao@....com.cn
Subject: [Patch] netxen_nic: Bugfix for wrong RUNNING status of NX3031 NICs with no
 link



From: Li Fengmao <li.fengmao@....com.cn>

Ifconfig command displays RUNNING status when there is no link on
NX3031 NICs. The problem is caused by the wrong calling order of
netif_carrier_off() and register_netdev() in netxen_setup_netdev(),
dev->reg_state is initialized to NETREG_UNINITIALIZED before
registering network device, so the linkwatch_fire_event() will not
be called to notify the link change event in netif_carrier_off(),
and the operational status of network device will be set to
IF_OPER_UNKNOWN. In that case, the IFF_RUNNING flags will be set,
which result in the wrong RUNNING status in the result of ifconfig
command.

It can be solved by calling netif_carrier_off() after
register_netdev() in netxen_setup_netdev() to ensure the
notification of the link change event. And then the operational
status of device will be set to IF_OPER_DOWN correctly.

Steps to reproduce the bug:
1. Prepare a NX3031 NIC with no network cable on it.
2. Reboot the system. (e.g exec reboot command)
3. Activate the interface. (e.g ifconfig eth0 up)
4. The operstatus of the NX3031 NIC will be RUNNING in the result of
ifconfig command.

Signed-off-by: Li Fengmao <li.fengmao@....com.cn>
Reviewed-by: Long Chun <long.chun@....com.cn>
Reviewed-by: Wang Liang <wang.liang82@....com.cn>
Reviewed-by: Cai Qu <cai.qu@....com.cn>
Reviewed-by: Jiang Biao <jiang.biao2@....com.cn>

--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1404,13 +1404,13 @@ netxen_setup_netdev(struct netxen_adapte
 	if (netxen_read_mac_addr(adapter))
 		dev_warn(&pdev->dev, "failed to read mac addr\n");

-	netif_carrier_off(netdev);
-
 	err = register_netdev(netdev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to register net device\n");
 		return err;
 	}
+
+	netif_carrier_off(netdev);

 	return 0;
 }

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