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: <20240712132915.54710-1-kiryushin@ancud.ru>
Date: Fri, 12 Jul 2024 16:29:15 +0300
From: Nikita Kiryushin <kiryushin@...ud.ru>
To: Sudarsana Kalluru <skalluru@...vell.com>
Cc: Nikita Kiryushin <kiryushin@...ud.ru>,
	Manish Chopra <manishc@...vell.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH net-next] bnx2x: turn off FCoE if storage MAC-address setup failed

As of now, initial storage MAC setup (in bnx2x_init_one) is not checked.

This can lead to unexpected FCoE behavior (as address will be in unexpected
state) without notice.

Check dev_addr_add for storage MAC and if it failes produce error message
and turn off FCoE feature.

Signed-off-by: Nikita Kiryushin <kiryushin@...ud.ru>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 678829646cec..c5d5e85777d4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13988,8 +13988,12 @@ static int bnx2x_init_one(struct pci_dev *pdev,
 	if (!NO_FCOE(bp)) {
 		/* Add storage MAC address */
 		rtnl_lock();
-		dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
+		rc = dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
 		rtnl_unlock();
+		if (rc) {
+			dev_err(&pdev->dev, "Cannot add storage MAC address\n");
+			bp->flags |= NO_FCOE_FLAG;
+		}
 	}
 	BNX2X_DEV_INFO(
 	       "%s (%c%d) PCI-E found at mem %lx, IRQ %d, node addr %pM\n",
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ