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

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)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1942 Β· 4 files
FileTypeDescriptionSize
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
VERDICT.md verdict source-confirmation analysis
↓ download 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<=0x100000 (>=4GiB buffer) -> size_i

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

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: (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)