On Mon, Nov 28, 2022 at 08:38:02PM +0300, Vitaliy Makkoveev wrote: > Subj. > > At sockets layer we touch only per-socket data, which is solock() > protected(). > > At protocol layer, unix(4) and key management sockets have no > (*pr_ctloutput)() handlers. route_ctloutput() touches only per socket > data, which is solock() protected. inet{,6} globals are protected by > netlock, which is solock() backend for corresponding sockets. >
Since getsockopt(2) and setsockopt(2) both follow the same (*pr_ctloutput)() handlers, it makes sense to unlock them both. Index: sys/kern/syscalls.master =================================================================== RCS file: /cvs/src/sys/kern/syscalls.master,v retrieving revision 1.236 diff -u -p -r1.236 syscalls.master --- sys/kern/syscalls.master 9 Nov 2022 10:26:28 -0000 1.236 +++ sys/kern/syscalls.master 29 Nov 2022 22:58:25 -0000 @@ -223,7 +223,7 @@ 103 STD { int sys_sigreturn(struct sigcontext *sigcntxp); } 104 STD { int sys_bind(int s, const struct sockaddr *name, \ socklen_t namelen); } -105 STD { int sys_setsockopt(int s, int level, int name, \ +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); } 107 STD { int sys_chflagsat(int fd, const char *path, \ @@ -249,7 +249,7 @@ struct timespec *timeout); } 117 STD NOLOCK { int sys_sendmmsg(int s, struct mmsghdr *mmsg,\ unsigned int vlen, int flags); } -118 STD { int sys_getsockopt(int s, int level, int name, \ +118 STD NOLOCK { int sys_getsockopt(int s, int level, int name, \ void *val, socklen_t *avalsize); } 119 STD { int sys_thrkill(pid_t tid, int signum, void *tcb); } 120 STD NOLOCK { ssize_t sys_readv(int fd, \