[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <686a83c9444b3_3aa654294e@willemb.c.googlers.com.notmuch>
Date: Sun, 06 Jul 2025 10:10:17 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Kuniyuki Iwashima <kuni1840@...il.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 1/7] af_unix: Don't hold unix_state_lock() in
__unix_dgram_recvmsg().
Kuniyuki Iwashima wrote:
> When __skb_try_recv_datagram() returns NULL in __unix_dgram_recvmsg(),
> we hold unix_state_lock() unconditionally.
>
> This is because SOCK_SEQPACKET sk needs to return EOF in case its peer
> has been close()d concurrently.
>
> This behaviour totally depends on the timing of the peer's close() and
> reading sk->sk_shutdown, and taking the lock does not play a role.
>
> Let's drop the lock from __unix_dgram_recvmsg() and use READ_ONCE().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Reviewed-by: Willem de Bruijn <willemb@...gle.com>
Powered by blists - more mailing lists