Skip to content

Commit 6e1918f

Browse files
q2venkuba-moo
authored andcommitted
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: 0cb8de3 ("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>
1 parent db1b4be commit 6e1918f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5250,8 +5250,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
52505250
if (bp->wol & MACB_WOL_ENABLED) {
52515251
/* Check for IP address in WOL ARP mode */
52525252
idev = __in_dev_get_rcu(bp->dev);
5253-
if (idev && idev->ifa_list)
5254-
ifa = rcu_access_pointer(idev->ifa_list);
5253+
if (idev)
5254+
ifa = rcu_dereference(idev->ifa_list);
52555255
if ((bp->wolopts & WAKE_ARP) && !ifa) {
52565256
netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n");
52575257
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)