DF-4052 / verdict.json
{ "finding_id": "DF-4052", "status": "untested", "reproduced": 0, "impact": "none", "confidence": "certain", "verdict": "Source-certain error-path typo: nfe_alloc_rx_ring (if_nfe.c:1725-1726) and nfe_alloc_tx_ring (:1988-1989) run for (j = 0; j < i; ++j) bus_dmamap_destroy(ring->data_tag, ring->data[i].map); - destroying the failing slots (NULL) map i times instead of the i successfully-created maps 0..i-1, which leak; dmat->map_count underflows by i because bus_dmamap_destroy decrements unconditionally (busdma_machdep.c:440-448). Verified NOT a double-free because bus_dmamap_create sets *mapp = NULL before returning error (busdma_machdep.c:425-433). Trigger is a bus_dmamap_create kmalloc failure mid-ring during attach (kernel memory pressure) on nfe(4) hardware - not reproducible on this guest (no nForce NIC), status untested. Low severity resource leak; classic pass-2 error-path class; one-character fix ([i] -> [j]) in both functions.", "exploit_chain": "", "evidence": "README.md/VERDICT.md with both loops quoted and the busdma semantics (NULL no-op destroy, unconditional map_count--) that bound impact to leak+counter-underflow", "kernel_refs": [ "sys/dev/netif/nfe/if_nfe.c:1725", "sys/dev/netif/nfe/if_nfe.c:1726", "sys/dev/netif/nfe/if_nfe.c:1988", "sys/dev/netif/nfe/if_nfe.c:1989", "sys/platform/pc64/x86_64/busdma_machdep.c:425", "sys/platform/pc64/x86_64/busdma_machdep.c:440" ], "poc_changes": "", "attempts": 0, "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64", "runtime_sec": 0, "guest_dirty": 0, "build_cmd": "", "run_cmd": "", "code_hash": "", "notes": "Early double-free hypothesis refuted by reading busdmamachdep (create NULLs *mapp on failure; destroy of NULL is a no-op).", "recommended_fix": "Index the destroy loop with j, not i, in both nfe_alloc_rx_ring and nfe_alloc_tx_ring; see fix.diff", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "Hardware-gated; one-character index fix, source-level only.", "fix_evidence": "findings/poc/DF-4052/fix.diff" } |