diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-08-28 11:04:20 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-08-28 11:10:22 +0000 |
| commit | 44b83210c8ad21e907de61584cfeb2752abee19b (patch) | |
| tree | 2a192a36639f9cd9bc453d54bcee8218083c7b96 /usr.bin/col/tests/(public-mirror) | |
| parent | 2c68ad49f13ddfa33735bd9bb6a3ca170a472ac0 (diff) | |
When connecting a unix domain stream socket, we
1. look up the peer (listening) socket,
2. allocate a new socket
3. add the new socket to the listening socket's queue
Prior to commit 26147c51546e, this sequence of operations was
synchronized by a pool mutex, also acquired in uipc_close().
After commit 26147c51546e, we drop the vnode pool lock immediately after
finding the peer socket via a filesystem lookup. This creates a window
where it's possible for a connection to add a new socket to the
listening queue after the listening queue has been aborted.
Fix the race by restoring the old behaviour of holding the pool lock
across the solisten_enqueue() call. This is a bit ugly since we need to
pass a mutex lock and a vnode through a couple of layers, but it seems
like a low-risk solution. Alternately we could add some flag to the
listening socket which indicates that no new connections are to be
accepted, but I think this will require some changes to the generic
socket code.
Reported by: pho
Fixes: 26147c51546e ("unix: pin the pathname peer by reference across the connect")
Reviewed by: olce, kib, John Ericson <John.Ericson@Obsidian.Systems>
Differential Revision: https://reviews.freebsd.org/D59201
Diffstat (limited to 'usr.bin/col/tests/(public-mirror)')
0 files changed, 0 insertions, 0 deletions
