diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-08-08 07:00:21 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-13 04:35:02 +0300 |
commit | 6e1918ff680527ce4be77426aa537012b5aa997c (patch) | |
tree | 8e3af2e63ce7265c1bded73713aadfdfbadb7d1c /drivers/net | |
parent | db1b4bedb9b97c6d34b03d03815147c04fffe8b4 (diff) | |
download | linux-6e1918ff680527ce4be77426aa537012b5aa997c.tar.xz |
net: macb: Use rcu_dereference() for idev->ifa_list in macb_suspend().
In macb_suspend(), idev->ifa_list is fetched with rcu_access_pointer()
and later the pointer is dereferenced as ifa->ifa_local.
So, idev->ifa_list must be fetched with rcu_dereference().
Fixes: 0cb8de39a776 ("net: macb: Add ARP support to WOL")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20240808040021.6971-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/cadence/macb_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 11665be3a22c..dcd3f54ed0cf 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5250,8 +5250,8 @@ static int __maybe_unused macb_suspend(struct device *dev) if (bp->wol & MACB_WOL_ENABLED) { /* Check for IP address in WOL ARP mode */ idev = __in_dev_get_rcu(bp->dev); - if (idev && idev->ifa_list) - ifa = rcu_access_pointer(idev->ifa_list); + if (idev) + ifa = rcu_dereference(idev->ifa_list); if ((bp->wolopts & WAKE_ARP) && !ifa) { netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n"); return -EOPNOTSUPP; |