netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: claudiu.beznea@tuxon.dev, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, kuni1840@gmail.com,
	netdev@vger.kernel.org, nicolas.ferre@microchip.com,
	pabeni@redhat.com
Subject: Re: [PATCH v1 net] net: macb: Use rcu_dereference() for idev->ifa_list in macb_suspend().
Date: Mon, 12 Aug 2024 14:41:40 +0530	[thread overview]
Message-ID: <733568cc-0a7d-4fc5-a251-2032fb484a4d@amd.com> (raw)
In-Reply-To: <20240808044516.12826-1-kuniyu@amazon.com>

On 08/08/24 10:15 am, Kuniyuki Iwashima wrote:
> From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
> Date: Thu, 8 Aug 2024 09:53:42 +0530
>> 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 ?
> 
> rcu_dereference() triggers lockdep splat if not called under
> rcu_read_lock().
> 
> Also in include/linux/rcupdate.h:
> 
> /**
>   * rcu_access_pointer() - fetch RCU pointer with no dereferencing
> ...
>   * It is usually best to test the rcu_access_pointer() return value
>   * directly in order to avoid accidental dereferences being introduced
>   * by later inattentive changes.  In other words, assigning the
>   * rcu_access_pointer() return value to a local variable results in an
>   * accident waiting to happen.
> 
> 
>> I sent initial patch with rcu_dereference, but there is a review comment:
>>
>> https://lore.kernel.org/netdev/a02fac3b21a97dc766d65c4ed2d080f1ed87e87e.camel@redhat.com/
> 
> I guess the following ifa_local was missed then ?

I am ok to use rcu_dereference(), just curios why the check 
idev->ifa_list was removed ?


vineeth

  reply	other threads:[~2024-08-12  9:11 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
2024-08-08  4:45   ` Kuniyuki Iwashima
2024-08-12  9:11     ` Vineeth Karumanchi [this message]
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=733568cc-0a7d-4fc5-a251-2032fb484a4d@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).