After switching to TCP_ESTABLISHED or TCP_LISTEN sk_state, alive SOCK_STREAM
and SOCK_SEQPACKET sockets can't change it anymore (since commit 3ff8bff704f4
"unix: Fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()").
Thus, we do not need to take lock here.
Signed-off-by: Kirill Tkhai <redacted>
---
v2: Initialize "nr_fds = 0".
net/unix/af_unix.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
After switching to TCP_ESTABLISHED or TCP_LISTEN sk_state, alive SOCK_STREAM
and SOCK_SEQPACKET sockets can't change it anymore (since commit 3ff8bff704f4
"unix: Fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()").
Thus, we do not need to take lock here.
Signed-off-by: Kirill Tkhai <redacted>
---
v2: Initialize "nr_fds = 0".
Yes, this is necessary because the new if-else does not cover
(SOCK_STREAM, TCP_CLOSE), and in such a case, nr_fds is
uninitialised val with the v1 patch.
This version looks good.
Reviewed-by: Kuniyuki Iwashima <redacted>
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:
On Sat, 14 Jan 2023 12:35:02 +0300 you wrote:
After switching to TCP_ESTABLISHED or TCP_LISTEN sk_state, alive SOCK_STREAM
and SOCK_SEQPACKET sockets can't change it anymore (since commit 3ff8bff704f4
"unix: Fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()").
Thus, we do not need to take lock here.
Signed-off-by: Kirill Tkhai <redacted>
[...]