]> git.baikalelectronics.ru Git - kernel.git/commit
unix: Fix an issue in unix_shutdown causing the other end read/write failures
authorJiang Wang <jiang.wang@bytedance.com>
Mon, 4 Oct 2021 23:25:28 +0000 (23:25 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 6 Oct 2021 12:40:21 +0000 (14:40 +0200)
commit1da06ea85c6fba572d21b8985549807235fb23a3
treea731f7ecafcf4deb48ad7e2ce2c4e304d3ed8e12
parentfa11a2c39ed64fd096c3eed5d1def888f678d66f
unix: Fix an issue in unix_shutdown causing the other end read/write failures

Commit d4a1875ddd1e ("af_unix: Add unix_stream_proto for sockmap") sets
unix domain socket peer state to TCP_CLOSE in unix_shutdown. This could
happen when the local end is shutdown but the other end is not. Then,
the other end will get read or write failures which is not expected.
Fix the issue by setting the local state to shutdown.

Fixes: d4a1875ddd1e ("af_unix: Add unix_stream_proto for sockmap")
Reported-by: Casey Schaufler <casey@schaufler-ca.com>
Suggested-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Jiang Wang <jiang.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211004232530.2377085-1-jiang.wang@bytedance.com
net/unix/af_unix.c