DF-4180 / verdict.json
{ "finding_id": "DF-4180", "status": "inconclusive", "reproduced": 0, "impact": "none", "confidence": "certain", "verdict": "Source-certain OOB index: twe_done uses the controller-supplied 8-bit response_id (TWE_Response_Queue.u.response_id, twereg.h:336) to index sc->twe_lookup[TWE_Q_LENGTH] (twe.c:1199) but TWE_Q_LENGTH==255 (twereg.h:152) and twe_setup fills only ids 0..254 (twe.c:140); a response_id of 255 reads twe_lookup[255] = the first 8 bytes of twe_drive[0] (td_size|td_cylinders, controller-groomable) as a struct twe_request *, then reads tr->tr_status and writes TWE_CMD_COMPLETE (twe.c:1203-1205) through that wild pointer. No userland trigger exists (the id comes from the controller response queue); not reproducible on this guest (no 3ware device at all). Robustness/panic-class on affected hardware; requires firmware malfunction or a malicious DMA device.", "exploit_chain": "", "evidence": "VERDICT.md (array layout + id-width trace); no runnable trigger by construction; fix.diff + fix_build.log", "kernel_refs": ["sys/dev/raid/twe/twe.c:1199", "sys/dev/raid/twe/twe.c:1203", "sys/dev/raid/twe/twe.c:1205", "sys/dev/raid/twe/twevar.h:135", "sys/dev/raid/twe/twereg.h:146", "sys/dev/raid/twe/twereg.h:152", "sys/dev/raid/twe/twereg.h:331"], "poc_changes": "n/a (no userland trigger - response ids are produced by the controller)", "attempts": 0, "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 x86_64", "runtime_sec": 0, "guest_dirty": 1, "build_cmd": "n/a", "run_cmd": "n/a", "code_hash": "d0f0e1b2d456700869fb4a8ba6d3ec8fe2dcaf753999a56e6d32564752834486", "notes": "Distinct from known DF-1430 (AEN unit indexes twe_drive[16] in twe_format_aen): this is the response-queue id indexing twe_lookup[255] one past. TWE_Q_LENGTH is 255, not 256, precisely because TWE_INIT_MESSAGE_CREDITS=0xff was chosen over 256 - the id space (8 bit) is one larger than the table.", "recommended_fix": "Bounds-check rq.u.response_id >= TWE_Q_LENGTH in twe_done and consume-and-drop such responses.", "fix_status": "inconclusive", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "Compile-validated only: fix.diff applied cleanly and batch-built into X86_64_GENERIC with -Werror, rc=0 (fix_build.log). Behavioral test impossible (requires a controller that emits id 255).", "fix_evidence": "fix_build.log excerpt (twe.c -Werror in-kernel + module)." } |