⬢ DragonFlyBSD Kernel Audit
DF-3387 / fix.diff
← back to finding ↓ download raw
--- a/sys/net/lagg/if_lagg.c	2026-09-11 23:48:59.584388685 +0000
+++ b/sys/net/lagg/if_lagg.c	2026-09-11 23:49:09.348262832 +0000
@@ -1466,8 +1466,10 @@
 		if (scifp->if_flags & IFF_MONITOR) {
 			m_freem(m);
 			m = NULL;
+			return;	/* consumed: monitor mode discards */
 		}
-		ether_reinput_oncpu(scifp, m, REINPUT_RUNBPF);	
+		else
+			ether_reinput_oncpu(scifp, m, REINPUT_RUNBPF);
 	}
 }
 
--- a/sys/net/if_ethersubr.c	2026-09-11 23:48:59.584388685 +0000
+++ b/sys/net/if_ethersubr.c	2026-09-11 23:49:09.360262678 +0000
@@ -1304,6 +1304,10 @@
 ether_reinput_oncpu(struct ifnet *ifp, struct mbuf *m, int reinput_flags)
 {
 	/* Discard packet if interface is not up */
+	if (m == NULL) {
+		/* defensive: callers must never pass NULL */
+		return;
+	}
 	if (!(ifp->if_flags & IFF_UP)) {
 		m_freem(m);
 		return;