⬢ DragonFlyBSD Kernel Audit
DF-3717 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/mxge/if_mxge.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/dev/netif/mxge/if_mxge.c	2026-09-15 22:30:00.534279904 +0000
@@ -4465,7 +4465,15 @@
 		sc->dying = 1;
 		if (ifp->if_flags & IFF_RUNNING)
 			mxge_close(sc, 1);
-		callout_stop(&sc->co_hdl);
+		/*
+		 * mxge_tick() blocks on main_serialize (held here), so a
+		 * synchronous callout_stop() would deadlock against it
+		 * (callout subsystem waits for the in-progress callback).
+		 * Stop asynchronously under the serializer and let the
+		 * callout_terminate() below drain it synchronously once
+		 * the serializers have been released.
+		 */
+		callout_stop_async(&sc->co_hdl);
 
 		mxge_teardown_intr(sc, sc->num_slices);