⬢ DragonFlyBSD Kernel Audit
DF-3261 / verdict.json
← back to finding ↓ download raw
{
 "finding_id": "DF-3261",
 "status": "reproduced",
 "reproduced": 1,
 "impact": "denial_of_service",
 "confidence": "certain",
 "verdict": "ipfw_check_ioc_rule never validates the set byte: rules installed via the same IP_FW_ADD sockopt the CLI uses with set=40 and set=200 are accepted (set subsystem is defined 0..31). ipfw -S list shows them as set 40 and set 200; ipfw set disable 8 instantly stops ALL THREE test rules (sets 40, 200 and the legal 8) from counting packets - on x86 the 1 << 40 and 1 << 200 classification-time shifts mask to 1 << 8 (ip_fw2.c:3601 UB) - and ipfw set move 40 to 0 refuses with invalid source number 40, so the administrator can never correctly administer such rules through the set API. Root-installed policy confusion plus C undefined behavior; no memory unsafety on x86.",
 "exploit_chain": "",
 "evidence": "run.log: installation output, the three counters frozen by set disable 8 and resumed by set enable 8, set move rejection",
 "kernel_refs": [
  "sys/net/ipfw/ip_fw2.c:4518",
  "sys/net/ipfw/ip_fw2.c:3601"
 ],
 "poc_changes": "three layout fixes: cmd words start at byte 60 (15 header words, cmd[1] embedded), total = 4*(15+cmd_len), and the opcode values are the enum ordinals (O_VIA=19, O_COUNT=46), not header line numbers",
 "attempts": 4,
 "guest_uname": "DragonFly dfbsd 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": 120,
 "guest_dirty": 0,
 "build_cmd": "guest: cc -O -o addset addset.c (raw IP_FW_ADD with exact ipfw_ioc_rule layout)",
 "run_cmd": "guest: kldload ipfw + staged allow rule; addset 40 1000; addset 200 1001; addset 8 1002; ping; ipfw set disable 8; ping; ipfw show",
 "code_hash": "e1008dec5997c89b5e682b66b83ddff5aff712763713817abdcd1ebb1a3c1701",
 "notes": "",
 "recommended_fix": "reject set >= 31 at install; combined fixed kernel: addset 40 is refused with invalid set while legal sets still install"
}