summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-07-03 23:05:22 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-07-03 23:05:22 +0000
commitfbfada6b0552a558578f183f0cc22dba33fc7435 (patch)
tree781034385e62d9895cc5e0d2a6582d64324c437b
parent448265baa5198da5cfbaf1aefe454757192fc73d (diff)
Do not grab the socket lock in doaccept() twice. Pass NOTE_SUBMIT
to KNOTE() as we are already holding the lock. Fixes "panic: rw_enter: netlock locking against myself" reported by Gregor Best and reproduced with src/regress/lib/libtls/gotls. OK millert@
-rw-r--r--sys/kern/uipc_syscalls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index acf671a65f3..e346c161d90 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.151 2017/03/27 11:45:49 bluhm Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.152 2017/07/03 23:05:21 bluhm Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -327,7 +327,7 @@ doaccept(struct proc *p, int sock, struct sockaddr *name, socklen_t *anamelen,
: (flags & SOCK_NONBLOCK ? FNONBLOCK : 0);
/* connection has been removed from the listen queue */
- KNOTE(&head->so_rcv.sb_sel.si_note, 0);
+ KNOTE(&head->so_rcv.sb_sel.si_note, NOTE_SUBMIT);
fp->f_type = DTYPE_SOCKET;
fp->f_flag = FREAD | FWRITE | nflag;