⬢ DragonFlyBSD Kernel Audit
DF-3850 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/dc/if_dc.c	2026-09-16 15:24:11.317338270 +0000
+++ b/sys/dev/netif/dc/if_dc.c	2026-09-16 15:24:11.349337868 +0000
@@ -2722,7 +2737,15 @@
 	struct mii_data *mii;
 	u_int32_t r;
 
-	lwkt_serialize_enter(ifp->if_serializer);
+	if (!lwkt_serialize_try(ifp->if_serializer)) {
+		/*
+		 * Never block the softclock thread on the serializer:
+		 * callout_stop() in dc_stop() waits synchronously for this
+		 * callback while holding it (AB-BA).  Retry next tick.
+		 */
+		callout_reset(&sc->dc_stat_timer, 1, dc_tick, sc);
+		return;
+	}
 
 	mii = device_get_softc(sc->dc_miibus);