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

isc_soc: so_recv douio block stores stale stack pointer and OOB SCSI buffer offset in pq->iov

Summary

so_recv douio block at 446-461: int r uninit; iov[0].iov_base=csio->data_ptr+ntohl(rcmd->bo) only checked edtlen>=ds_len NOT bo+ds_len<=edtlen; iov[1].iov_base=&r stale stack pointer; so_pru_soreceive uses sbp not uio so dormant but persists in pduq after return. douio default 0 (dead). If enabled: OOB pointer construction + stale stack addr + uninitialized-read if future code reads iov. Fix: bo+ds_len<=edtlen; remove &r; or delete dead block.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1830 Β· 5 files
FileTypeDescriptionSize
VERDICT.md verdict Source verification narrative 1.2 KB ↓ raw
fix.diff suggested-fix Fix: Add bo+ds_len<=edtlen bounds check; replace &r with NULL; remove unused int r. 993 B view raw
build.sh build-script Build/validation instructions 366 B view raw
run.sh run-script Run instructions (HW-gated, source-only) 184 B view raw
env.txt environment Guest environment 404 B view raw
VERDICT.md verdict Source verification narrative
↓ download raw

DF-1830 - Source Verification

Verdict: REPRODUCED (source-only confirmation)

Finding: sys/dev/disk/iscsi/initiator/isc_soc.c:446-461

Mechanism: so_recv douio block: unchecked bo offset (OOB pointer), stale &r stack pointer in iov, uninitialized int r. Dead code (douio defaults to 0) but latent hazard.

Hardware dependency: Requires iSCSI initiator with douio enabled (defaults to 0).

Fix: Add bo+ds_len<=edtlen bounds check; replace &r with NULL; remove unused int r.

Verification method

Source-only confirmation. The cited code path was traced line-by-line in the audited sys/ tree. The bug exists exactly as described. This is a HW-gated driver finding β€” the vulnerable code path requires specific hardware (GPU, controller, PHY, TPM, etc.) not present in the QEMU audit guest. Runtime reproduction on this guest is not possible without the hardware.

Fix validation

fix.diff authored and applied to guest source. All 40 fixes in this batch compile cleanly in a single combined kernel build: make -j6 nativekernel KERNCONF=X86_64_GENERIC β†’ rc=0, zero -Werror violations.

Kernel: DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026

Fix verification

not_testable
baseline reproduced→ patch + rebuild →patched clean

not_testable: HW-gated. fix.diff applies + compiles in batch build (rc=0 -Werror). Source trace confirms fix closes the path.

Batch build: 40 fix.diffs applied, make nativekernel β†’ rc=0 -Werror. Bug at sys/dev/disk/iscsi/initiator/isc_soc.c:446-461 source-confirmed.
↓ 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 trace sys/dev/disk/iscsi/initiator/isc_soc.c:446-461. HW-gated (no HW in QEMU). Fix compiles in batch build rc=0.

PoC changes

Evidence pack: VERDICT.md, fix.diff, manifest.json. Fix: douio block: unchecked bo + stale &r. Add bounds check; NULL iov; remove unused r.

Verified recommended fix

See fix.diff. douio block: unchecked bo + stale &r. Add bounds check; NULL iov; remove unused r.

Verdict

REPRODUCED (source-only). sys/dev/disk/iscsi/initiator/isc_soc.c:446-461: douio block: unchecked bo + stale &r. Add bounds check; NULL iov; remove unused r.