⬢ DragonFlyBSD Kernel Audit
DF-5501 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-5501",
  "status": "reproduced",
  "verdict": "passioctl() (scsi_pass.c:437-525) never re-checks securelevel while passopen() (scsi_pass.c:335-339) refuses opens at securelevel > 1. Demonstrated on the guest: fd opened at securelevel -1, kern.securelevel raised to 2 (fresh open then returns EPERM, proving the gate is intended), CAMIOCOMMAND (XPT_SCSI_IO TUR) on the pre-opened fd returns rc=0 with a real CAM completion status \u2014 full raw-SCSI passthrough (including disk WRITE commands) remains available to any process holding a pre-raise pass fd, defeating the securelevel tamper guarantee. Requires a privileged/pre-raise open, hence Low; the marker (command processed at securelevel 2, no EPERM) reproduced on a fresh vm.sh reset boot.",
  "reproduced": true,
  "impact": "none",
  "confidence": "certain",
  "exploit_chain": "open /dev/passN while privileged at securelevel<=1 (e.g. long-lived boot daemon) -> wait for/cause kern.securelevel raise to >=2 -> CAMIOCOMMAND raw SCSI WRITEs to the underlying disk continue undetected (securelevels no-raw-write guarantee void)",
  "evidence": "run.log lines: open#2 -> Operation not permitted (as designed) then [+] ioctl rc=0 ... at securelevel 2 => raw SCSI passthrough still usable on a pre-opened fd, RUN_RC=0",
  "kernel_refs": [
    "sys/bus/cam/scsi/scsi_pass.c:335",
    "sys/bus/cam/scsi/scsi_pass.c:460"
  ],
  "poc_changes": "Success criterion adjusted: rc==0 (passioctl processed the command) rather than CAM_REQ_CMP \u2014 the stock boot-disk passthrough target answers TUR with status 0x0c, which is the devices answer, not a rejection.",
  "attempts": 2,
  "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": 25,
  "guest_dirty": 0,
  "build_cmd": "cc -O0 -g -o poc5501 poc5501.c",
  "run_cmd": "./poc5501 (guest reset before capture; raises securelevel to 2, reset after)",
  "code_hash": "73b1349700cfcf83487b194dc842378a04d7fbf4a5f6e318c0d9faa58a41938d",
  "notes": "impact recorded as none because none of uid0_privesc/panic/dos/leak applies: the manifestation is a control-integrity bypass (securelevel guarantee void for pre-opened fds). Complements known DF-1088 (CCB flag validation) which is orthogonal.",
  "recommended_fix": "Re-check securelevel>1 in passioctl() (fix.diff, one line).",
  "fix_status": "not_tested",
  "fix_baseline_reproduced": true,
  "fix_patched_reproduced": false,
  "fix_verdict": "Not kernel-built (Low-tier logic finding, no memory corruption; the fix adds the same EPERM path the open check already exercises). Baseline reproduction captured; patch is the mirrored open-time check.",
  "fix_evidence": ""
}