[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <be05d2bd-0745-1639-df26-401e175b0332@gmail.com>
Date: Sat, 4 May 2019 14:06:30 -0400
From: Eric Dumazet <eric.dumazet@...il.com>
To: Florian Westphal <fw@...len.de>
Cc: Networking <netdev@...r.kernel.org>,
David Ahern <dsahern@...il.com>
Subject: Re: [RFC] ifa_list needs proper rcu protection
On 5/4/19 2:01 PM, Florian Westphal wrote:
> Eric Dumazet <eric.dumazet@...il.com> wrote:
>
> Sorry for late reply.
>
>> It looks that unless RTNL is held, accessing ifa_list needs proper RCU protection ?
>>
>> indev->ifa_list can be changed under us by another cpu (which owns RTNL)
>>
>> Lets took an example.
>>
>> (A proper rcu_dereference() with an happy sparse support would require adding __rcu attribute,
>> I put a READ_ONCE() which should be just fine in this particular context)
>
> I don't see e.g. __inet_insert_ifa() use rcu_assign_pointer() or similar
> primitive, so I don't think its enough to change readers.
>
> Same for __inet_del_ifa(), i see freeing gets dealyed via call_rcu, but
> it uses normal assignemts instead of a rcu helper.
>
> So, I am afraid we will have to sprinkle some rcu_assign_/derefence in
> several places.
Yes, I came to the same conclusion.
Powered by blists - more mailing lists