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

Unbounded loop in cxm_saa7115_configure reads past saa7115_scalings[]/saa7115_audio_clock[] (missing i< before NUM_ELEMENTS)

Summary

cxm_saa7115.c:825 for (i=0; NUM_ELEMENTS(saa7115_scalings); i++) missing i< before NUM_ELEMENTS -> constant 6 truthy -> always true. 894 same for saa7115_audio_clock constant 4. Loop exits only via break on match; no-match reads past static const tables OOB. Post-loop guard if(i>=NUM_ELEMENTS) unreachable on no-match path. Latent: sole caller cxm_configure_encoder passes only valid codec_profile tuples. If future profile with unrepresented dimensions/sample_rate -> OOB read panic or wild pointer deref at 834/902. Fix: for(i=0;i<NUM_ELEMENTS(...);i++).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1622 Β· 1 files
FileTypeDescriptionSize
fix.diff suggested-fix Unbounded loop in cxm_saa7115_configure reads past saa7115_scalings[]/saa7115_au 470 B view raw

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

fix.diff applied + combined nativekernel build rc=0 (-Werror)

fix.diff applied + combined nativekernel build rc=0 (-Werror)
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Info severity)

Evidence (decisive lines)

Source-confirmed at sys/dev/video/cxm/cxm_saa7115.c:825: unbounded loop (missing i< before NUM_ELEMENTS)

Verified recommended fix

Source-confirmed at sys/dev/video/cxm/cxm_saa7115.c:825: unbounded loop (missing i< before NUM_ELEMENTS)

Verdict

Source-confirmed at sys/dev/video/cxm/cxm_saa7115.c:825: unbounded loop (missing i< before NUM_ELEMENTS)