Unlock peer in the SOCK_STREAM and SOCK_SEQPACKET error path.
authormvs <mvs@openbsd.org>
Sat, 2 Jul 2022 11:49:23 +0000 (11:49 +0000)
committermvs <mvs@openbsd.org>
Sat, 2 Jul 2022 11:49:23 +0000 (11:49 +0000)
Reported-by: syzbot+a648408d6a58fd40b59a@syzkaller.appspotmail.com
by anton@

sys/kern/uipc_usrreq.c

index 0710393..0fb95ee 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uipc_usrreq.c,v 1.166 2022/07/01 09:56:17 mvs Exp $   */
+/*     $OpenBSD: uipc_usrreq.c,v 1.167 2022/07/02 11:49:23 mvs Exp $   */
 /*     $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $        */
 
 /*
@@ -362,6 +362,7 @@ uipc_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
                                    control)) {
                                        control = NULL;
                                } else {
+                                       sounlock(so2);
                                        error = ENOBUFS;
                                        break;
                                }