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:   Sat, 18 Sep 2021 19:26:32 +0200
From:   Christian Lamparter <chunkeey@...il.com>
To:     netdev@...r.kernel.org, bcm-kernel-feedback-list@...adcom.com
Cc:     Jakub Kicinski <kuba@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Rafał Miłecki <rafal@...ecki.pl>
Subject: [PATCH] net: bgmac-bcma: handle deferred probe error due to mac-address

Since the inclusion of nvmem into the helper function
of_get_mac_address() by
commit d01f449c008a ("of_net: add NVMEM support to of_get_mac_address")
it has been possible to receive a -EPROBE_DEFER return code during boot.
Previously, this resulted in setting a random ethernet address.

This exact issue happened on my Meraki MR32. This is because the nvmem
provider is an EEPROM (at24) which gets instantiated once the module
driver is loaded... which of course happens much later when the
filesystem becomes available.

With this patch, the probe will propagate this error code. The
driver subsystem will reschedule the probe at a later time,
once the nvmem is in place and ready to deliver the requested
mac-address.

Signed-off-by: Christian Lamparter <chunkeey@...il.com>
---
 drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c
index 85fa0ab7201c..9513cfb5ba58 100644
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
@@ -129,6 +129,8 @@ static int bgmac_probe(struct bcma_device *core)
 	bcma_set_drvdata(core, bgmac);
 
 	err = of_get_mac_address(bgmac->dev->of_node, bgmac->net_dev->dev_addr);
+	if (err == -EPROBE_DEFER)
+		return err;
 
 	/* If no MAC address assigned via device tree, check SPROM */
 	if (err) {
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ