diff options
| author | Sunday Clement <Sunday.Clement@amd.com> | 2026-08-06 10:59:34 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-08-25 18:18:44 -0400 |
| commit | 40ba09e11188d1b7f79d51fc28aca5ea45e0c138 (patch) | |
| tree | 8ae3f9ff91f69c21862f9e1f3087e5aa6c46e3bc /scripts/const_structs.checkpatch | |
| parent | 2ee9836545e690c9e66ec203445d7705959fd7a8 (diff) | |
| download | linux-40ba09e11188d1b7f79d51fc28aca5ea45e0c138.tar.gz linux-40ba09e11188d1b7f79d51fc28aca5ea45e0c138.zip | |
drm/amdkfd: Reject zero-sized AQL queue allocations after size halving
KFD_IOC_ALLOC_MEMORY_OF_GPU with flag
KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM and size=1 triggers the AQL
wraparound workaround (size >>= 1), reducing size to 0. The resulting
zero passes through PAGE_ALIGN(0) = 0 without validation, bypassing the
per-process VRAM quota check in reserve_mem_limit()
(vram_used + 0 > vram_available is always false).
The fix adds post-halving zero-size validation in the primary
allocation path (amdgpu_amdkfd_gpuvm.c). The check happens after size
halving but before reserve_mem_limit(), and uses err_alignment_size
error path to properly clean up the allocated kgd_mem structure and
mutex.
Cc: stable@vger.kernel.org
Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Reviewed-by: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
