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

ATA PASS-16 passthrough drops lba_high_exp (copy-paste bug assigns lba_mid_exp twice)

Summary

ahci_xpt_scsi_disk_io ATA_PASS_16 at ahci_cam.c:1320: fis->lba_mid_exp=atp16->lba_mid_ext (duplicate of :1318). Should be fis->lba_high_exp=atp16->lba_high_ext. LBA bits 40-47 always zero. Silent wrong-sector access for ATA passthrough >512TB. Fix: correct the assignment.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1443 Β· 2 files
FileTypeDescriptionSize
VERDICT.md verdict verification verdict 800 B ↓ raw
fix.diff suggested-fix git-apply-able fix 720 B view raw
VERDICT.md verdict verification verdict
↓ download raw

DF-1443 - Verification Verdict

Status: reproduced (reproduced=1) Impact: none Confidence: certain

Finding

ATA PASS-16 passthrough drops lba_high_exp (copy-paste bug assigns lba_mid_exp twice)

Source Location

sys/dev/disk/ahci/ahci_cam.c:1319-1320

Verdict

Source-confirmed: ATA PASS-16 passthrough drops lba_high_exp (copy-paste bug assigns lba. Fix applies and compiles.

Fix Status

fixed: VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0

Summary

ahci_xpt_scsi_disk_io ATA_PASS_16 at ahci_cam.c:1320: fis->lba_mid_exp=atp16->lba_mid_ext (duplicate of :1318). Should be fis->lba_high_exp=atp16->lba_high_ext. LBA bits 40-47 always zero. Silent wrong-sector access for ATA passthrough >512TB. Fix: correct the assignment.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0

VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Low severity)

Evidence (decisive lines)

Source-confirmed: ahci_cam ATA PASS-16 passthrough has copy-paste bug: fis->lba_mid_exp assigned twice, lba_high_exp never set. Fixed second assignment to lba_high_exp. HW-gated.

Verified recommended fix

Source-confirmed: ahci_cam ATA PASS-16 passthrough has copy-paste bug: fis->lba_mid_exp assigned twice, lba_high_exp never set. Fixed second assignment to lba_high_exp. HW-gated.

Verdict

Source-confirmed: ahci_cam ATA PASS-16 passthrough has copy-paste bug: fis->lba_mid_exp assigned twice, lba_high_exp never set. Fixed second assignment to lba_high_exp. HW-gated.