Re: [PATCH net] sctp: hold socket lock when dumping endpoints in sctp_diag

Simon Horman <[email protected]> Tue, 16 Jun 2026 08:24:08 +0100
Newsgroups org.kernel.vger.linux-sctp,org.kernel.vger.netdev
Message-ID <[email protected]>
On Mon, Jun 15, 2026 at 02:24:34PM -0400, Xin Long wrote:
> On Mon, Jun 15, 2026 at 7:04 AM Simon Horman <[email protected]> wrote:
> >
> > This is an AI-generated review of your patch. The human sending this
> > email has considered the AI review valid, or at least plausible.
> > Full review at: https://netdev-ai.bots.linux.dev/sashiko/

...

> Low: #1, #2, #5, not really issues,
> but worth mentioning about it in changelog.
> 
> Critical: #3, not valid.
> socket refcnt can't be 0 when traversing the chain under read_lock_bh().
> 
> But it seems better to hold ep instead sk, and also to check
> ep->base.dead instead of sk_state CLOSED.
> 
> Medium: #4, not valid.
> it's completely okay to dump duplicate or skip socks because of
> concurrent close() and listen() in diag.
> 
> will post v2 with some improvements mentioned above.

Thanks, much appreciated.