[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKDKR+PDXMO9e76+NJt_a-WMGaD1Gk7Yer7Mn4hD2sX9A@mail.gmail.com>
Date: Tue, 29 Aug 2023 21:23:50 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Xin Long <lucien.xin@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org,
eric.dumazet@...il.com, syzbot <syzkaller@...glegroups.com>,
Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Subject: Re: [PATCH net] sctp: annotate data-races around sk->sk_wmem_queued
On Tue, Aug 29, 2023 at 9:05 PM Xin Long <lucien.xin@...il.com> wrote:
>
> On Tue, Aug 29, 2023 at 2:19 PM Eric Dumazet <edumazet@...gle.com> wrote:
> >
> > On Tue, Aug 29, 2023 at 8:14 PM Xin Long <lucien.xin@...il.com> wrote:
> > >
> > > On Mon, Aug 28, 2023 at 8:44 AM Eric Dumazet <edumazet@...gle.com> wrote:
> > > >
> > > > sk->sk_wmem_queued can be read locklessly from sctp_poll()
> > > >
> > > > sk->sk_rcvbuf);
> > > Just wondering why sk->sk_sndbuf/sk_rcvbuf doesn't need READ_ONCE()
> > > while adding READ_ONCE for sk->sk_wmem_queued in here?
> > >
> >
> > Separate patches for sk_sndbuf, sk_rcvbuf, sk_err, sk_shutdown, and
> > many other socket fields.
> >
> > I prefer having small patches to reduce merge conflicts in backports.
> >
> > Note that I used READ_ONCE(sk->sk_sndbuf) in sctp_writeable(),
> > (I assume this is why you asked)
> Yes.
>
> Not sure about tcp's seq_show, but as sctp_assocs_seq_show() is only
tcp seq_show uses requested spinlocks on lhash or ehash tables, but
not socket lock.
> under rcu_read_lock() and with a hold of transport/association/socket,
> does it mean all members of assoc should also use READ_ONCE()?
Probably...
> (Note I think we don't expect the seq show to be that accurate.)
Yeah, this is really best effort, inet_diag is probably what we want
to harden these days.
Powered by blists - more mailing lists