]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: Initialize fences array entries in radeon_sa_bo_next_hole
authorXiaohui Zhang <xiaohuizhang@ruc.edu.cn>
Tue, 7 Jun 2022 15:19:33 +0000 (23:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 8 Jun 2022 15:41:09 +0000 (11:41 -0400)
commit67653ca0064536fc277b8c33225cf30e905f258a
tree0cab399e9047754dc2415a618ee7033f71dc2ead
parent2432a42e89d601504ceec4d932f0189d5dab1e81
drm/radeon: Initialize fences array entries in radeon_sa_bo_next_hole

Similar to the handling of amdgpu_sa_bo_next_hole in commit 8dbf6a9d3c3b
("drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole"),
we thought a patch might be needed here as well.

The entries were only initialized once in radeon_sa_bo_new. If a fence
wasn't signalled yet in the first radeon_sa_bo_next_hole call, but then
got signalled before a later radeon_sa_bo_next_hole call, it could
destroy the fence but leave its pointer in the array, resulting in
use-after-free in radeon_sa_bo_new.

Signed-off-by: Xiaohui Zhang <xiaohuizhang@ruc.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_sa.c