DF-3776 / manifest.json
{ "finding_id": "DF-3776", "file": "sys/dev/netif/jme/if_jme.c", "verdict": "inconclusive", "impact_class": "none", "reproduce": { "build": "scp findings/poc/DF-3776/{Makefile,jme_callout_replica.c} dfbsd:/root/kmod/ ; vm.sh run_root 'cd /root/kmod && make'", "run": "vm.sh run_root 'kldload /root/kmod/jme_callout_replica.ko; sysctl kern.jmereplica.arm=1; sleep 2; sysctl kern.jmereplica.stop_try=1; (sysctl kern.jmereplica.stop_blk=1 >/dev/null 2>&1 &); sleep 6; dmesg | grep \"jmereplica[blk]\" | tail -2; ps -o pid,stat,wchan,command -ax | grep stop_blk | grep -v grep'", "expected": "Mechanism PROVEN on the guest kernel by deterministic replica of if_jme.c's exact callout/serializer protocol; jme-specific runtime hardware-gated (inconclusive per family convention). jme_tick (sys/dev/netif/jme/if_jme.c:2566-2582) is a CPU0-pinned MP callout whose callback BLOCKS in lwkt_serialize_enter (&sc->jme_serialize, :2571) and self re-arms at hz (:2579); jme_stop (:2907) and jme_miibus_statchg (:409) tear it down with the synchronous callout_stop() while holding ALL driver serializers (ASSERT_IFNET_SERIALIZED_ALL :2898). DragonFly callout_stop waits for an in-progress callback (sys/kern/kern_timeout.c:1091 -> _callout_cancel_or_stop sync=1, ssleep 'costp' :920). A parked tick therefore deadlocks against the stopper (AB-BA): both threads wedge permanently (sysctl thread D-state wchan 'costp'), the driver serializers are never released, and the CPU0 softclock stops delivering ALL callouts. Replica on the guest: stop under the full serializer array with the jme_tick-shaped handler parked -> callout_stop NEVER returned; fix-shape control (try-enter + 1-tick retry) -> callout_stop returned, pending=0." }, "kernel_refs": [ "sys/dev/netif/jme/if_jme.c:772", "sys/dev/netif/jme/if_jme.c:2571", "sys/dev/netif/jme/if_jme.c:2579", "sys/dev/netif/jme/if_jme.c:2881", "sys/dev/netif/jme/if_jme.c:2898", "sys/dev/netif/jme/if_jme.c:2907", "sys/dev/netif/jme/if_jme.c:409", "sys/dev/netif/jme/if_jme.c:1092", "sys/dev/netif/jme/if_jme.c:1589", "sys/dev/netif/jme/if_jme.c:1913", "sys/dev/netif/jme/if_jme.c:2672", "sys/kern/kern_timeout.c:1091", "sys/kern/kern_timeout.c:920", "sys/kern/kern_timeout.c:423" ], "artifacts": [ "README.md", "VERDICT.md", "jme_callout_replica.c", "Makefile", "build.sh", "run.sh", "build.log", "run.log", "run.2.log", "fix_build.log", "env.txt", "fix.diff", "manifest.json", "verdict.json" ] } |