summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2018-01-25 14:04:36 +0000
committermpi <mpi@openbsd.org>2018-01-25 14:04:36 +0000
commit043047e1d73eb585ded6355d328b034a624e1e87 (patch)
treede630f739db225ffd5e0d3e415d3b7fade7b1a0a
parentcertificate options are case-sensitive; fix case on one that had it wrong. (diff)
downloadwireguard-openbsd-043047e1d73eb585ded6355d328b034a624e1e87.tar.xz
wireguard-openbsd-043047e1d73eb585ded6355d328b034a624e1e87.zip
Assert that ifiq_destroy() is not called with the NET_LOCK() held.
Calling taskq_barrier() on a softnet thread while holding the lock is clearly a deadlock. ok visa@, dlg@, bluhm@
-rw-r--r--sys/net/ifq.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/net/ifq.c b/sys/net/ifq.c
index 99b4704f8d0..d790f433a6e 100644
--- a/sys/net/ifq.c
+++ b/sys/net/ifq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifq.c,v 1.21 2018/01/04 11:02:57 tb Exp $ */
+/* $OpenBSD: ifq.c,v 1.22 2018/01/25 14:04:36 mpi Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@@ -446,15 +446,8 @@ void
ifiq_destroy(struct ifiqueue *ifiq)
{
if (!task_del(ifiq->ifiq_softnet, &ifiq->ifiq_task)) {
- int netlocked = (rw_status(&netlock) == RW_WRITE);
-
- if (netlocked) /* XXXSMP breaks atomicity */
- NET_UNLOCK();
-
+ NET_ASSERT_UNLOCKED();
taskq_barrier(ifiq->ifiq_softnet);
-
- if (netlocked)
- NET_LOCK();
}
/* don't need to lock because this is the last use of the ifiq */