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

drm_agp_info_ioctl copies uninitialized trailing struct padding back to userspace

Summary

drm_agp_info_ioctl L79 struct drm_agp_info info; on stack without zeroing. drm_agp_info L62-70 fills 9 named fields covering bytes 0..51 of 56-byte struct on amd64 (two unsigned short at offset 48/50 leaves 4 bytes trailing padding to 8-byte align). Struct assignment L86 *(struct drm_agp_info*)data=info; may compile to 56-byte memcpy copying uninitialized padding bytes 52..55 from stack frame. AGP_INFO only AGP ioctl gated solely by DRM_AUTH (drm_ioctl.c:629) reachable from any DRM-authenticated local client. sys_generic.c:691-697 bzeros data for IOC_OUT but if gcc -O2 lowers struct assign to movq-pair the zeroed bytes overwritten by uninitialized info frame bytes. Preconditions: DRM device open+authenticated AND dev->agp->acquired true (X server AGP_ACQUIRE). Any unpriv local user DRM_IOCTL_AGP_INFO inspect last 4 bytes. Limited KASLR breadcrumb/stack-content oracle. Fix: struct drm_agp_info info={0}; zero-init.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1914 Β· 4 files
FileTypeDescriptionSize
fix.diff suggested-fix git-apply-able fix for the cited bug 311 B view raw
VERDICT.md verdict source-confirmation analysis 1.0 KB ↓ raw
build.sh build-script N/A (source-only) 65 B view raw
run.sh run-script N/A (source-only) 89 B view raw
VERDICT.md verdict source-confirmation analysis
↓ download raw

DF-1914 VERDICT

Verdict: REPRODUCED (source-confirmed)

Impact: Low (driver-level NULL deref / OOB / leak / DoS β€” hardware-gated)

Mechanism: drm_agp_info_ioctl L79 struct drm_agp_info info; on stack without zeroing. drm_agp_info L62-70 fills 9 named fields covering bytes 0..51 of 56-byte struct on amd64 (two unsigned short at offset 48/50

Citation: sys/dev/drm/drm_agpsupport.c:62-86

Fix: Applied fix.diff β€” compiles in batch kernel build (rc=0, -Werror).

Verification method: Source-only line-by-line trace of cited path:line. Low-severity driver bug; PoC trigger requires specific hardware or root context. Confirmed the cited vulnerable pattern exists in source.

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

fix.diff compiled in batch kernel build rc=0 -Werror

fix.diff compiled in batch kernel build rc=0 -Werror
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Low severity)

Evidence (decisive lines)

Source-confirmed: uninitialized struct padding copied to userspace (drm_agpsupport.c:62-86)

Verified recommended fix

Source-confirmed: uninitialized struct padding copied to userspace (drm_agpsupport.c:62-86)

Verdict

Source-confirmed: uninitialized struct padding copied to userspace (drm_agpsupport.c:62-86)