Integer overflow in r600_copy_dma size_in_dw: silent short/zero-length GPU copy with successful fence (latent on R600, live on rv770/evergreen siblings)
Summary
r600_dma.c L451 size_in_dw/cur_size_in_dw declared u32. L457 size_in_dw=(num_gpu_pages<<RADEON_GPU_PAGE_SHIFT)/4 shift 12 in 32-bit unsigned wraps for num_gpu_pages>=0x100000 (>=4GiB buffer) -> size_in_dw=0 -> num_loops=0 -> for-loop never executes -> no DMA packets but L483 fence_emit signals success. Caller ttm_bo_move_accel_cleanup believes copy complete re-points BO metadata destination has stale data. REACHABILITY CAVEAT: on R600/RV610/RV630 r600_copy_dma is .dma not .copy (r600_copy_cpdma is .copy). Only reached via radeon_test/benchmark boot tunable default 0. Latent in-tree; same pattern rv770_dma.c:57/evergreen_dma.c:121 IS user-reachable (.copy path). Fix: u64 intermediate reject num_gpu_pages>U32_MAX>>12.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1942 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited bug | 441 B | view raw |
| VERDICT.md | verdict | source-confirmation analysis | 709 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-1942 VERDICT
Verdict: REPRODUCED (source-confirmed)
Impact: Low (driver-level NULL deref / OOB / leak / DoS β hardware-gated)
Mechanism: r600_dma.c L451 size_in_dw/cur_size_in_dw declared u32. L457 size_in_dw=(num_gpu_pages<
Citation: sys/dev/drm/radeon/r600_dma.c:457-490
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: (num_gpu_pages<<12)/4 overflow yields 0-size silent DMA (r600_dma.c:457)
Verified recommended fix
Source-confirmed: (num_gpu_pages<<12)/4 overflow yields 0-size silent DMA (r600_dma.c:457)
Verdict
Source-confirmed: (num_gpu_pages<<12)/4 overflow yields 0-size silent DMA (r600_dma.c:457)
No comments yet.