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

NULL dereference in drm_pick_cmdline_mode when drm_mode_create_from_cmdline_mode fails under OOM

Summary

drm_pick_cmdline_mode at drm_fb_helper.c:2176-2178: mode=drm_mode_create_from_cmdline_mode(dev,cmdline_mode) then list_add(&mode->head,...) with NO NULL check. drm_mode_create_from_cmdline_mode returns NULL on OOM (drm_modes.c:1611-1612). &mode->head near-NULL -> list_add writes through it -> page fault panic. Trigger: video= cmdline mode + OOM + display hotplug/lastclose. Fix: if(!mode) return NULL.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1267 Β· 2 files
FileTypeDescriptionSize
VERDICT.md verdict verification verdict 1.3 KB ↓ raw
fix.diff suggested-fix git-apply-able fix 380 B view raw
VERDICT.md verdict verification verdict
↓ download raw

DF-1267 - Verification Verdict

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

Finding

NULL dereference in drm_pick_cmdline_mode when drm_mode_create_from_cmdline_mode fails under OOM

Source Location

sys/dev/drm/drm_fb_helper.c:2176-2178

Verdict

Source-confirmed: NULL dereference in drm_pick_cmdline_mode when drm_mode_create_from_cm. 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

drm_pick_cmdline_mode at drm_fb_helper.c:2176-2178: mode=drm_mode_create_from_cmdline_mode(dev,cmdline_mode) then list_add(&mode->head,...) with NO NULL check. drm_mode_create_from_cmdline_mode returns NULL on OOM (drm_modes.c:1611-1612). &mode->head near-NULL -> list_add writes through it -> page fault panic. Trigger: video= cmdline mode + OOM + display hotplug/lastclose. Fix: if(!mode) return NULL.

Fix status (batch validation)

Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.

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: drm_pick_cmdline_mode dereferences mode from drm_mode_create_from_cmdline_mode without NULL check under OOM. Added NULL check.

Verified recommended fix

Source-confirmed: drm_pick_cmdline_mode dereferences mode from drm_mode_create_from_cmdline_mode without NULL check under OOM. Added NULL check.

Verdict

Source-confirmed: drm_pick_cmdline_mode dereferences mode from drm_mode_create_from_cmdline_mode without NULL check under OOM. Added NULL check.