Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Florian Fainelli
Thu, 12 Nov 2026 04:52
[PATCH net v2 06/12] net: au1000: assign a valid MAC address without platform data
Author: Florian Fainelli
Date: Thu, 12 Nov 2026 04:52
Date: Thu, 12 Nov 2026 04:52
26 lines
12173 bytes
12173 bytes
The supported no-platform-data path leaves dev_addr as all zeroes. The
device can register but eth_validate_addr() prevents it from opening.
Generate a random address just as for platform data containing an
invalid address.
Fixes: 7718f2c27dbd ("au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/amd/au1000_eth.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 5ce106d0389f..ea8f7787dd5d 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1196,6 +1196,7 @@ static int au1000_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "no platform_data passed,"
" PHY search on MAC0\n");
aup->phy1_search_mac0 = 1;
+ eth_hw_addr_random(dev);
} else {
if (is_valid_ether_addr(pd->mac)) {
eth_hw_addr_set(dev, pd->mac);
--
2.53.0
Re: [PATCH net v2 06/12] net: au1000: assign a valid MAC address without platform data
Author: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:50
Date: Mon, 16 Nov 2026 13:50
57 lines
10205 bytes
10205 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message overstates how far the bug reaches, and it
carries a Fixes: tag.
--
net: au1000: assign a valid MAC address without platform data
When no platform data is passed, au1000_probe() now calls
eth_hw_addr_random(). Before this, the device kept an all-zero dev_addr,
and eth_validate_addr() rejected it at open time.
> The supported no-platform-data path leaves dev_addr as all zeroes. The
> device can register but eth_validate_addr() prevents it from opening.
[Severity: Low]
Can any in-tree configuration actually reach this path?
The only in-tree au1000-eth platform devices are au1xxx_eth0_device and
au1xxx_eth1_device in arch/mips/alchemy/common/platform.c. Both always set
platform_data:
.platform_data = &au1xxx_eth0_platform_data,
au1xxx_override_eth_cfg() is the board override path, used by
board-mtx1.c. It copies into the same static structures, so the pointer
stays non-NULL:
if (port == 0)
memcpy(&au1xxx_eth0_platform_data, eth_data,
sizeof(struct au1000_eth_platform_data));
au1000_eth_driver has no of_match_table or id_table. It can only bind by
name to the platform devices above.
So dev_get_platdata() never seems to return NULL for an in-tree user. The
failure described could only happen with out-of-tree board code that
registers the device without platform data.
The code change itself looks correct. It restores what the !pd branch did
before 7718f2c27dbd, which only added eth_hw_addr_random() to the
invalid-MAC branch.
> Fixes: 7718f2c27dbd ("au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()")
Could the commit message say that only out-of-tree platform code can hit
this, or describe the change as hardening? As written, the Fixes: tag may
lead to a stable backport for a failure no mainline configuration can hit.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com
Re: [PATCH net v2 06/12] net: au1000: assign a valid MAC address without platform data
Author: Florian Fainelli
Date: Tue, 17 Nov 2026 19:11
Date: Tue, 17 Nov 2026 19:11
62 lines
13615 bytes
13615 bytes
On 11/16/26 05:50, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
>
> Low priority / nit picks for your consideration:
>
> - [Low] The commit message overstates how far the bug reaches, and it
> carries a Fixes: tag.
>
> --
>
> net: au1000: assign a valid MAC address without platform data
>
> When no platform data is passed, au1000_probe() now calls
> eth_hw_addr_random(). Before this, the device kept an all-zero dev_addr,
> and eth_validate_addr() rejected it at open time.
>
>> The supported no-platform-data path leaves dev_addr as all zeroes. The
>> device can register but eth_validate_addr() prevents it from opening.
>
> [Severity: Low]
> Can any in-tree configuration actually reach this path?
>
> The only in-tree au1000-eth platform devices are au1xxx_eth0_device and
> au1xxx_eth1_device in arch/mips/alchemy/common/platform.c. Both always set
> platform_data:
>
> .platform_data = &au1xxx_eth0_platform_data,
>
> au1xxx_override_eth_cfg() is the board override path, used by
> board-mtx1.c. It copies into the same static structures, so the pointer
> stays non-NULL:
>
> if (port == 0)
> memcpy(&au1xxx_eth0_platform_data, eth_data,
> sizeof(struct au1000_eth_platform_data));
>
> au1000_eth_driver has no of_match_table or id_table. It can only bind by
> name to the platform devices above.
>
> So dev_get_platdata() never seems to return NULL for an in-tree user. The
> failure described could only happen with out-of-tree board code that
> registers the device without platform data.
>
> The code change itself looks correct. It restores what the !pd branch did
> before 7718f2c27dbd, which only added eth_hw_addr_random() to the
> invalid-MAC branch.
>
>> Fixes: 7718f2c27dbd ("au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()")
>
> Could the commit message say that only out-of-tree platform code can hit
> this, or describe the change as hardening? As written, the Fixes: tag may
> lead to a stable backport for a failure no mainline configuration can hit.
>
Yes this is more of a defensive change, I will drop it from this series.
pw-bot: not applicable
--
Florian
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads