Index | Thread | Search

From:
Vitaliy Makkoveev <mvs@openbsd.org>
Subject:
Unlock listen(2)
To:
tech@openbsd.org
Date:
Fri, 26 Jan 2024 15:19:33 +0300

Download raw body.

Thread
  • Vitaliy Makkoveev:

    Unlock listen(2)

Only unix(4) and tcp(4) sockets inplements (*pru_listen)(). For the
unix(4) case the uipc_listen() is pretty simple `unp_vnode' check. For
the tcp(4) case tcp_listen() this is the in_pcbbind() invocation which
uses `inpt_mtx' mutex(9) for protection. Also, exclusive netlock is
held during the call.

Index: sys/kern/syscalls.master
===================================================================
RCS file: /cvs/src/sys/kern/syscalls.master,v
retrieving revision 1.256
diff -u -p -r1.256 syscalls.master
--- sys/kern/syscalls.master	21 Dec 2023 19:34:07 -0000	1.256
+++ sys/kern/syscalls.master	26 Jan 2024 12:11:16 -0000
@@ -223,7 +223,7 @@
 			    socklen_t namelen); }
 105	STD NOLOCK	{ int sys_setsockopt(int s, int level, int name, \
 			    const void *val, socklen_t valsize); }
-106	STD		{ int sys_listen(int s, int backlog); }
+106	STD NOLOCK	{ int sys_listen(int s, int backlog); }
 107	STD		{ int sys_chflagsat(int fd, const char *path, \
 			    u_int flags, int atflags); }
 108	STD NOLOCK	{ int sys_pledge(const char *promises, \