eth: fbnic: take netif_addr_lock_bh() around rx mode address programming
Subsystems (3)
PATCH 1/1 eth: fbnic: take netif_addr_lock_bh() around rx mode address programming
When __fbnic_set_rx_mode() is called from contexts other than .ndo_set_rx_mode_async(), the uc and mc addr lists are accessed without the addr lock that __hw_addr_sync_dev() and __hw_addr_unsync_dev() require. Wrap these unprotected accesses with netif_addr_lock_bh(). fbnic_clear_rx_mode() has similar issues.
--- drivers/net/ethernet/meta/fbnic/fbnic_netdev.c | 7 ++++++- drivers/net/ethernet/meta/fbnic/fbnic_pci.c | 4 ++++ drivers/net/ethernet/meta/fbnic/fbnic_rpc.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c +6 -1
@@ -262,8 +262,11 @@ static int fbnic_set_mac(struct net_device *netdev, void *p)eth_hw_addr_set (netdev, addr->sa_data); -if (netif_running (netdev)) +if (netif_running (netdev)) { +netif_addr_lock_bh (netdev);__fbnic_set_rx_mode (fbn->fbd, &netdev->uc, &netdev->mc); +netif_addr_unlock_bh (netdev); + }return 0 ; }
@@ -308,8 +311,10 @@ void fbnic_clear_rx_mode(struct fbnic_dev *fbd)/* Write updates to hardware */ fbnic_write_macda (fbd); +netif_addr_lock_bh (netdev);__dev_uc_unsync (netdev,NULL );__dev_mc_unsync (netdev,NULL ); +netif_addr_unlock_bh (netdev); } static int fbnic_hwtstamp_get(struct net_device *netdev,
drivers/net/ethernet/meta/fbnic/fbnic_pci.c +4 -0
@@ -135,7 +135,9 @@ void fbnic_up(struct fbnic_net *fbn)fbnic_rss_reinit_hw (fbn->fbd, fbn); +netif_addr_lock_bh (fbn->netdev);__fbnic_set_rx_mode (fbn->fbd, &fbn->netdev->uc, &fbn->netdev->mc); +netif_addr_unlock_bh (fbn->netdev);/* Enable Tx/Rx processing */ fbnic_napi_enable (fbn);
@@ -180,7 +182,9 @@ static int fbnic_fw_config_after_crash(struct fbnic_dev *fbd) }fbnic_rpc_reset_valid_entries (fbd); +netif_addr_lock_bh (fbd->netdev);__fbnic_set_rx_mode (fbd, &fbd->netdev->uc, &fbd->netdev->mc); +netif_addr_unlock_bh (fbd->netdev);return 0 ; }
drivers/net/ethernet/meta/fbnic/fbnic_rpc.c +2 -0
@@ -244,7 +244,9 @@ void fbnic_bmc_rpc_check(struct fbnic_dev *fbd)if (fbd->fw_cap.need_bmc_tcam_reinit) {fbnic_bmc_rpc_init (fbd); +netif_addr_lock_bh (fbd->netdev);__fbnic_set_rx_mode (fbd, &fbd->netdev->uc, &fbd->netdev->mc); +netif_addr_unlock_bh (fbd->netdev); fbd->fw_cap.need_bmc_tcam_reinit = false; }
---
base-commit: 406e8a651a7b854c41fecd5117bb282b3a6c2c6b
change-id: 20260616-linux-fbnic-hwaddr-fe83ccc72c13
Best regards,
Signature · 1 line
Daniel Zahka <[email protected]>
Quoted 9 lines · Daniel Zahka
When
__fbnic_set_rx_mode()is called from contexts other than .ndo_set_rx_mode_async(), the uc and mc addr lists are accessed without the addr lock that__hw_addr_sync_dev()and__hw_addr_unsync_dev()require. Wrap these unprotected accesses withnetif_addr_lock_bh().fbnic_clear_rx_mode()has similar issues.Fixes eb690ef8d1c2 ("eth: fbnic: Add L2 address programming")Assisted-by Claude:claude-opus-4-8Signed-off-by Daniel Zahka <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Wed, 17 Jun 2026 03:39:49 -0700 you wrote:
When
__fbnic_set_rx_mode()is called from contexts other than .ndo_set_rx_mode_async(), the uc and mc addr lists are accessed without the addr lock that__hw_addr_sync_dev()and__hw_addr_unsync_dev()require. Wrap these unprotected accesses withnetif_addr_lock_bh().fbnic_clear_rx_mode()has similar issues.Fixes eb690ef8d1c2 ("eth: fbnic: Add L2 address programming")Assisted-by Claude:claude-opus-4-8Signed-off-by Daniel Zahka <[email protected]>[...]
Here is the summary with links:
- [net] eth: fbnic: take netif_addr_lock_bh() around rx mode address programming
https://git.kernel.org/netdev/net/c/96e7f9122aae
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html