[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <889fad3d-33a6-4e51-83f2-7df9634c7055@redhat.com>
Date: Wed, 23 Oct 2024 13:16:28 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Rémi Denis-Courmont <remi@...lab.net>,
Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 5/9] phonet: Don't hold RTNL for
getaddr_dumpit().
On 10/23/24 13:04, Paolo Abeni wrote:
> On 10/19/24 09:48, Rémi Denis-Courmont wrote:
>>> I think bit-field read/write need not be atomic here because even
>>> if a data-race happens, for_each_set_bit() iterates each bit, which
>>> is the real data, regardless of whether data-race happened or not.
>>
>> Err, it looks to me that a corrupt bit would lead to the index getting corrupt
>> and addresses getting skipped or repeated. AFAICT, the RTNL lock is still
>> needed here.
>
> To wrap-up Kuniyuki's reply: addresses can't be repeated in dump. They
> can be 'skipped' meaning the dump can race with writer reading an 'old'
> address bitmask, still not containing the 'new' address. Exactly as
> could happen with racing dump/writer both protected by the lock.
>
> The bottom line is that this code looks safe to me.
I'm sorry, I forgot to ask the obvious question: @Rémi, are you ok with
this explanation and patch as-is?
Thanks!
Paolo
Powered by blists - more mailing lists