drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 12 Sep 2018 16:07:10 +0000 (18:07 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Sep 2018 14:37:17 +0000 (09:37 -0500)
commit6a15f3ff19a8dd394e3a21480512c2cb98e26b3c
treedec9fec3936245a92700ac5792af8c3d062070c6
parent520cbe0f4a7f170ec0d1167a827bcbec74aef4f4
drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole

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

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c