netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuni1840@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH v1 net] net: macb: Use rcu_dereference() for idev->ifa_list in macb_suspend().
Date: Thu, 8 Aug 2024 09:53:42 +0530	[thread overview]
Message-ID: <7a61eaff-3ea4-4eba-a11f-7c4caaef45dd@amd.com> (raw)
In-Reply-To: <20240808040021.6971-1-kuniyu@amazon.com>

Hi Kuniyuki,

On 08/08/24 9:30 am, Kuniyuki Iwashima wrote:
> 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().
> 

Is there any functional breakage ?

I sent initial patch with rcu_dereference, but there is a review comment:

https://lore.kernel.org/netdev/a02fac3b21a97dc766d65c4ed2d080f1ed87e87e.camel@redhat.com/ 



🙏 vineeth

> Fixes: 0cb8de39a776 ("net: macb: Add ARP support to WOL")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> ---
>   drivers/net/ethernet/cadence/macb_main.c | 4 ++--
>   1 file 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;

  reply	other threads:[~2024-08-08  4:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  4:00 [PATCH v1 net] net: macb: Use rcu_dereference() for idev->ifa_list in macb_suspend() Kuniyuki Iwashima
2024-08-08  4:23 ` Vineeth Karumanchi [this message]
2024-08-08  4:45   ` Kuniyuki Iwashima
2024-08-12  9:11     ` Vineeth Karumanchi
2024-08-12 18:35       ` Kuniyuki Iwashima
2024-08-13  1:40 ` Jakub Kicinski
2024-08-13  1:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a61eaff-3ea4-4eba-a11f-7c4caaef45dd@amd.com \
    --to=vineeth.karumanchi@amd.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).