⬢ DragonFlyBSD Kernel Audit
DF-3368 / fix.diff
← back to finding ↓ download raw
--- a/sys/net/netmap/netmap_vale.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/net/netmap/netmap_vale.c	2026-09-11 14:28:49.673863609 +0000
@@ -995,7 +995,11 @@
 			(void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot);
 		prefetch(buf);
 		++ft_i;
-		if (slot->flags & NS_MOREFRAG) {
+		/* Cap fragment chains at the documented NM_MULTISEG limit:
+		 * a longer chain is treated as terminating here, so ft_i
+		 * can never run past NM_BDG_BATCH_MAX entries and ft_frags
+		 * (uint8_t) can never truncate. */
+		if ((slot->flags & NS_MOREFRAG) && frags < NM_MULTISEG) {
 			frags++;
 			continue;
 		}