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

Reader never validates DMSGF_SIZE against the base command β€” undersized extended headers reach command dispatch (latent type confusion)

Summary

kdmsg_iocom_thread_rd accepts any DMSGF_SIZE (1..32 = 64..2048 bytes) for any base command and sizes the kdmsg_msg allocation from the wire SIZE alone; nothing verifies the header carries the structure the base command implies. Today's consumers are mostly protected by accident (tcmd constants embed canonical SIZE; default cases reject); subr_diskiocom dispatches on state->rxcmd so mid-stream undersized messages still reach disk handlers, but their deepest field reads stay inside the 120-byte SIZE=1 allocation. No OOB demonstrable with current consumers; structural hazard for any future deep-reading handler. Size-vs-command table fix proposed.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-5826 Β· 1 files
FileTypeDescriptionSize
verdict.json file 1.0 KB view raw

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean
per-fix-DF-5826

Confirmed kernel references

Detail

Evidence (decisive lines)

static trace; cross-refs in DF-5825 evidence pack

Verified recommended fix

cmd-SIZE table at reader boundary

Verdict

untested (Info/Low hardening or race-bound leak - Phase V not applicable or not economical per contract; DF-5825 pack carries the transport proof)