linux/net/unix
John Ericson f0d9c3ffc2 af_unix: fix listen() succeeding on sockets in the wrong state
Commit fd0a109a0f ("net, pidfs: prepare for handing out pidfds for
reaped sk->sk_peer_pid") inserted a prepare_peercred() call between err
= -EINVAL and the socket-state check in unix_listen(). Since
prepare_peercred() leaves err at 0 on success, listen() on an AF_UNIX
socket that is not in TCP_CLOSE or TCP_LISTEN state (e.g. one that is
already connected) now silently returns success without doing anything,
instead of failing with EINVAL as it did before.

Fixes: fd0a109a0f ("net, pidfs: prepare for handing out pidfds for reaped sk->sk_peer_pid")
Signed-off-by: John Ericson <mail@johnericson.me>
Link: https://patch.msgid.link/20260718182903.2295560-1-John.Ericson@Obsidian.Systems
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-24 15:10:05 -07:00
..
af_unix.c af_unix: fix listen() succeeding on sockets in the wrong state 2026-07-24 15:10:05 -07:00
af_unix.h af_unix: Give up GC if MSG_PEEK intervened. 2026-03-12 13:37:18 -07:00
diag.c vfs-7.1-rc1.kino 2026-04-13 12:19:01 -07:00
garbage.c af_unix: Set gc_in_progress to true in unix_gc(). 2026-05-04 18:34:45 -07:00
Kconfig af_unix: Add a prompt to CONFIG_AF_UNIX_OOB 2024-12-19 19:16:15 -08:00
Makefile af_unix: Remove CONFIG_UNIX_SCM. 2024-01-31 16:41:16 -08:00
sysctl_net_unix.c af_unix: Clean up #include under net/unix/. 2025-03-25 04:30:07 -07:00
unix_bpf.c bpf, sockmap: Fix af_unix null-ptr-deref in proto update 2026-04-15 17:22:58 -07:00