From 043047e1d73eb585ded6355d328b034a624e1e87 Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 25 Jan 2018 14:04:36 +0000 Subject: [PATCH] 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@ --- sys/net/ifq.c | 11 ++--------- 1 file 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 @@ -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 */ -- 2.20.1