we acquiring kernel lock with mutex(9) held. This partially reverts
rev 1.205 of sys/kern/uipc_syscalls.c. Shared solock() is still fine for
getsockname(2) and getpeername(2).
Reported-by: syzbot+00a4824cb1b6a214c7d6@syzkaller.appspotmail.com
ok kn@ claudio@
-/* $OpenBSD: uipc_syscalls.c,v 1.207 2022/12/07 01:02:28 deraadt Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.208 2023/01/12 10:59:36 mvs Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
valsize = 0;
m = m_get(M_WAIT, MT_SOOPTS);
so = fp->f_data;
- solock_shared(so);
+ solock(so);
error = sogetopt(so, SCARG(uap, level), SCARG(uap, name), m);
- sounlock_shared(so);
+ sounlock(so);
if (error == 0 && SCARG(uap, val) && valsize && m != NULL) {
if (valsize > m->m_len)
valsize = m->m_len;