[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+GJB=ZN7q0G_i+Q2DLvw6=3Ma8L0B7dDqLXLbBKUQdOw@mail.gmail.com>
Date: Mon, 28 Aug 2023 17:30:05 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: David Laight <David.Laight@...lab.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"eric.dumazet@...il.com" <eric.dumazet@...il.com>, syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH net] net: read sk->sk_family once in sk_mc_loop()
On Mon, Aug 28, 2023 at 4:21 PM David Laight <David.Laight@...lab.com> wrote:
>
> From: Eric Dumazet
> > Sent: 28 August 2023 12:31
> >
> > syzbot is playing with IPV6_ADDRFORM quite a lot these days,
> > and managed to hit the WARN_ON_ONCE(1) in sk_mc_loop()
> >
> > We have many more similar issues to fix.
>
> Is it worth revisiting the use of volatile?
What would you suggest ?
> If all accesses to a field have to be marked READ_ONCE()
> and WRITE_ONCE() then isn't that just 'volatile'?
Not all accesses to this field need to be volatile.
For instance, many readers also hold the socket lock,
the field can not change for them.
>
> IIRC READ_ONCE() (well ACCESS_ONCE()) was originally only
> used to stop the compiler re-reading a value.
> The current code also worries about the compiler generating
> non-atomic read/write (even to a 32bit word).
> So typically all references end up being annotated.
Not in sections with mutual exclusion.
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
Powered by blists - more mailing lists