mirror of
https://github.com/torvalds/linux.git
synced 2026-09-19 09:08:02 +02:00
Add a regression test for the unix_listen() state check. The key case is
listen() on a bound socket that has already been connected: it is no
longer in TCP_CLOSE or TCP_LISTEN, so it must fail with EINVAL. A
prepare_peercred() call slipped in ahead of that check once left err at 0
and made listen() silently succeed there instead; this guards against a
repeat.
The neighbouring outcomes are covered too so they cannot regress the same
way: a bound socket in TCP_CLOSE listens fine, calling listen() again on a
socket already in TCP_LISTEN is allowed, and an unbound socket fails with
EINVAL.
Each case runs for both listenable socket types (SOCK_STREAM and
SOCK_SEQPACKET) and both pathname and abstract addresses.
Fixes:
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| config | ||
| diag_uid.c | ||
| Makefile | ||
| msg_oob.c | ||
| scm_inq.c | ||
| scm_pidfd.c | ||
| scm_rights.c | ||
| so_peek_off.c | ||
| unix_connect.c | ||
| unix_connreset.c | ||
| unix_listen.c | ||