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

NULL-pointer dereference at attach when Envy24 subsystem unknown and EEPROM absent

Summary

envy24_init at envy24.c:2409: sc->cfg=NULL. :2422 if NULL, cfg=envy24_rom2cfg(sc) which returns NULL if EEPROM absent/short (<GPIODIR+1) or I2C read fails. :2426 sc->adcn=((sc->cfg->scfg&ADC)>>2)+1 derefs NULL -> page fault panic. Triggered when subvendor/subdevice not in cfg_table AND no EEPROM. Malicious/defective Envy24 PCI device (hotplug). Fix: check cfg!=NULL after rom2cfg, return ENXIO.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

DF-1322 - Verification Verdict

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

Finding

NULL-pointer dereference at attach when Envy24 subsystem unknown and EEPROM absent

Source Location

sys/dev/sound/pci/envy24.c:2409-2426

Verdict

Source-confirmed: NULL-pointer dereference at attach when Envy24 subsystem unknown and E. 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

envy24_init at envy24.c:2409: sc->cfg=NULL. :2422 if NULL, cfg=envy24_rom2cfg(sc) which returns NULL if EEPROM absent/short (adcn=((sc->cfg->scfg&ADC)>>2)+1 derefs NULL -> page fault panic. Triggered when subvendor/subdevice not in cfg_table AND no EEPROM. Malicious/defective Envy24 PCI device (hotplug). Fix: check cfg!=NULL after rom2cfg, return ENXIO.

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: envy24 attach sc->cfg can be NULL after envy24_rom2cfg when EEPROM absent, subsequent deref of sc->cfg->scfg causes NULL-deref. Added NULL check. HW-gated.

Verified recommended fix

Source-confirmed: envy24 attach sc->cfg can be NULL after envy24_rom2cfg when EEPROM absent, subsequent deref of sc->cfg->scfg causes NULL-deref. Added NULL check. HW-gated.

Verdict

Source-confirmed: envy24 attach sc->cfg can be NULL after envy24_rom2cfg when EEPROM absent, subsequent deref of sc->cfg->scfg causes NULL-deref. Added NULL check. HW-gated.