⬢ DragonFlyBSD Kernel Audit
DF-4028 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-4028",
  "status": "not_reproduced",
  "reproduced": 0,
  "impact": "none",
  "confidence": "certain",
  "verdict": "Source-certain validator bypass: r600_cs_track_validate_cb unconditionally writes the computed CB_COLORn_SIZE dword to ib[track->cb_color_size_idx[i]] (r600_cs.c:468), and that index defaults to 0 (r600_cs.c:309) when userspace never writes the CB_COLORn_SIZE register. A CS that programs CB_COLOR0_INFO (valid format, LINEAR_GENERAL), CB_TARGET_MASK and CB_COLOR0_BASE (+reloc) but omits CB_COLOR0_SIZE makes the kernel write 0 into ib[0] AFTER the IB was validated \u2014 the GPU then re-walks the IB from ib[0]=0 (type0/count0 packet consuming ib[0],ib[1]) and executes attacker dwords that were validated only as SET_ALU_CONST payload values. Complete defeat of the CS security boundary (arbitrary forbidden registers/packets incl. CP DMA with raw addresses). Runtime reproduction impossible on the audit guest: /dev/dri absent (no radeon GPU, only QEMU virtio display); arithmetic of the ib[0] := 0 write proven line-exact by cb_rewrite_sim on the guest.",
  "exploit_chain": "On r600/rv770 KMS hardware: submit CS from an unprivileged render-context -> validator patches ib[0]=0 at the draw packet -> GPU executes hidden packet stream (SET_CONTEXT_REG to forbidden regs / PACKET3_CP_DMA with raw 40-bit addresses) -> arbitrary GPU/PCIe writes (physical memory on non-IOMMU systems) -> uid=0. Chain is source-derived; not exercisable on this guest.",
  "evidence": "VERDICT.md (full path:line trace); run.log (guest trigger run + arithmetic simulation proving the validator math line-exact); build.log (clean guest build); env.txt (guest has no radeon GPU \u2014 hardware-gated); fix.diff (proposed fix, NOT applied to sys/)",
  "kernel_refs": [
    "sys/dev/drm/radeon/r600_cs.c:309",
    "sys/dev/drm/radeon/r600_cs.c:363",
    "sys/dev/drm/radeon/r600_cs.c:413-450",
    "sys/dev/drm/radeon/r600_cs.c:463-468",
    "sys/dev/drm/radeon/r600_cs.c:552-556",
    "sys/dev/drm/radeon/r600_cs.c:752-770",
    "sys/dev/drm/radeon/r600_cs.c:1176-1179",
    "sys/dev/drm/radeon/radeon_cs.c:768-773"
  ],
  "poc_changes": "Trigger written from scratch for this pack (raw ioctl, no libdrm, self-contained struct defs); arithmetic sims written to verify each wrap/desync claim line-exact; past-IB hypothesis for DF-4029 explicitly tested and killed by resource_index_sim.",
  "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": 45,
  "guest_dirty": 0,
  "build_cmd": "./build.sh (guest: cc -O2 -Wall)",
  "run_cmd": "./run.sh",
  "code_hash": "da0d9a886161bddfef7392d94a40d9e170e476914de693e08ebd3f3c693fc288",
  "notes": "Hardware-gated: the audit QEMU guest exposes no radeon DRM device (/dev/dri absent, QEMU virtio display only \u2014 env.txt), so the run-time chain cannot be exercised; classification is not_reproduced at run-time with certain source-level confidence. All findings verified present in upstream Linux master too (cve_match candidates: equivalent).",
  "recommended_fix": "Guard !track->cb_color_size_idx[i] before the rewrite (see fix.diff), mirroring the DB-side guard at r600_cs.c:553.",
  "fix_status": "not_testable",
  "fix_baseline_reproduced": 0,
  "fix_patched_reproduced": 0,
  "fix_verdict": "fix.diff authored against the read-only sys/ tree after source verification; baseline and patched runs require r600/rv770 hardware which the audit guest lacks, so fix validation is not testable here.",
  "fix_evidence": "fix.diff in this pack"
}