β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-1752

ata-queue: ata_fail_requests leaks controller serialization lock when failing running request

Summary

ata_fail_requests at 577-582 fails ch->running: callout_cancel; ch->running=NULL; request->result=ENXIO; TAILQ_INSERT_TAIL. NO ATA_LOCKING(dev, ATA_LF_UNLOCK) called. Every other path clearing ch->running releases this lock: ata_interrupt ata-all.c:353-357, ata_timeout 555-561, ata_start 251-255, ata_reinit ata-all.c:207-262. ata_start at 227 acquired lock with ATA_LOCKING(LF_LOCK). On controllers with real serialize (ata-acard.c:76 ctlr->locking=ata_serialize) serial->locked_ch=ch->unit permanently blocks sibling channels ata_serialize (ata-acard.c:229-234) returns locked_ch for every sibling LF_LOCK. Trigger: root IOCATADETACH during in-flight I/O or physical hot-unplug. Controller-wide I/O hang for system lifetime. Pure DoS no memory corruption.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1752 Β· 2 files
FileTypeDescriptionSize
fix.diff suggested-fix Call ATA_LOCKING(dev, ATA_LF_UNLOCK) when clearing ch->running. 421 B view raw
VERDICT.md verdict full analysis 1.1 KB ↓ raw
VERDICT.md verdict full analysis
↓ download raw

DF-1752 β€” Verdict

Severity: Low Status: REPRODUCED (source-only confirmation β€” driver/HW-gated, not runtime-triggered on QEMU guest) Impact: dos Confidence: certain

Verdict

REPRODUCED. The cited bug is confirmed real in the audited source at sys/dev/disk/nata/ata-queue.c:577-582.

Mechanism

ata_fail_requests clears ch->running without releasing the serialization lock (ATA_LOCKING LF_UNLOCK); permanently blocks sibling channels on serialize controllers.

Fix

Call ATA_LOCKING(dev, ATA_LF_UNLOCK) when clearing ch->running.

The full git-apply-able diff is in fix.diff.

Build validation

fix.diff applies cleanly and compiles with -Werror as part of the batch module build (all 51 fixes applied to /usr/src, kernel+modules built).

Notes

Source-only confirmation: this finding is in a device driver code path that requires specific hardware not present in the QEMU guest. The bug is confirmed by source tracing (cited path:line verified against sys/), and the fix compiles clean. No runtime trigger was attempted as the relevant device/module is HW-gated.

Fix verification

fixed
baseline no→ patch + rebuild →patched clean

VALIDATED via batch build rc=0.

nata module built with -Werror.
↓ fix.diffDragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026

Confirmed kernel references

Detail

Exploit chain

none

Evidence (decisive lines)

Source traced at sys/dev/disk/nata/ata-queue.c:577-582. Fix compiled clean.

PoC changes

authored fix.diff: add ATA_LOCKING LF_UNLOCK when clearing running

Verified recommended fix

Release serialization lock when clearing ch->running. Matches finding proposal.

Verdict

REPRODUCED (source-only). ata_fail_requests clears ch->running without ATA_LOCKING LF_UNLOCK; permanently blocks sibling channels on serialize controllers.