DF-3967 / verdict.json
{ "finding_id": "DF-3967", "status": "not_reproduced", "reproduced": 0, "impact": "none", "confidence": "likely", "verdict": "Device-fed TX-completion desync in rt2661_tx_intr (rt2661.c:896-960): qid (val>>8)&0xf values 5..15 are silently attributed to the mgt ring (:906); results are matched to the drivers sequential stat cursor (:909) rather than a device index, so reordered/duplicated STA_CSR4 entries complete the wrong slot \u2014 freeing an in-flight mbuf via ieee80211_tx_complete (:959) while the device may still DMA it \u2014 and the unguarded txq->queued-- (:955) underflows on spurious entries, defeating the ring-full gate (:1687) so the post path reuses device-owned slots; the ni==NULL continue (:916-917) also leaks m. Requires a misbehaving/compromised NIC (same trust bar as sibling rt2860 DF-3749, different mechanism). Not reproduced: no Ralink hardware on the guest.", "exploit_chain": "device posts duplicated/reordered TX_STAT_VALID entries -> stat cursor desync -> ieee80211_tx_complete frees an mbuf whose cluster the device still DMAs into -> freed-cluster reuse corruption window; independently queued<0 reopens a full ring -> slot overwrite while pending.", "evidence": "VERDICT.md (cursor/gate analysis path:line), trigger.c, env.txt, fix.diff (qid guard + m free + queued floor)", "kernel_refs": [ "sys/dev/netif/ral/rt2661.c:896", "sys/dev/netif/ral/rt2661.c:905", "sys/dev/netif/ral/rt2661.c:906", "sys/dev/netif/ral/rt2661.c:909", "sys/dev/netif/ral/rt2661.c:916", "sys/dev/netif/ral/rt2661.c:955", "sys/dev/netif/ral/rt2661.c:1687", "sys/dev/netif/ral/rt2661reg.h:191" ], "poc_changes": "Informational trigger only (needs device firmware control / PCIe emulation).", "attempts": 1, "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": 4, "guest_dirty": 0, "build_cmd": "guest: cd /usr/src/sys/dev/netif/ral && patch -p1 < fix.diff && make # after make obj", "run_cmd": "dfbsd-qemu/vm.sh run_root pciconf -lv | grep -i ralink", "code_hash": "afd5d98654a69db97a8ae19d8c5e0d02494268104000eb97beaac3060d74cd98", "notes": "Pass-2 finding, checklist item (b). Confidence likely (not certain) because exploitation requires device misbehavior beyond the drivers own state machine.", "recommended_fix": "Validate qid<=4, free m on the ni==NULL path, and floor txq->queued at zero (fix.diff).", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff closes the three gap (qid mapping, m leak, queued underflow); git apply --check clean. Runtime validation needs the NIC fix.diff applied to the guest /usr/src copy and the if_ral.ko module rebuilt clean with -Werror (build.log; combined with the other two rt2661 fix.diffs of this batch); runtime validation still impossible without the NIC.", "fix_evidence": "fix.diff; fix.diff applied to the guest /usr/src copy and the if_ral.ko module rebuilt clean with -Werror (build.log; combined with the other two rt2661 fix.diffs of this batch); runtime validation still impossible without the NIC." } |