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)
PoC verification
Evidence pack
findings/poc/DF-1914 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited bug | 311 B | view raw |
| VERDICT.md | verdict | source-confirmation analysis | 706 B | β raw |
| build.sh | build-script | N/A (source-only) | 61 B | view raw |
| run.sh | run-script | N/A (source-only) | 87 B | view 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 verification
fixedfix.diff compiled in batch kernel build rc=0 -Werror
fix.diff compiled in batch kernel build rc=0 -Werror
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)
No comments yet.