]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/amdgpu: fix bad job hw_fence use after free in advance tdr
authorJingwen Chen <Jingwen.Chen2@amd.com>
Fri, 22 Oct 2021 03:30:01 +0000 (11:30 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Nov 2021 16:22:07 +0000 (12:22 -0400)
commit9c4a8e361d4bff747206584638324d2f32ff8a94
tree4bf915eaa67a28b281f8e8fb2650cf1332ba82b9
parentec60885c0932af8e251e91f2c46c9b364c891f32
drm/amd/amdgpu: fix bad job hw_fence use after free in advance tdr

[Why]
In advance tdr mode, the real bad job will be resubmitted twice, while
in drm_sched_resubmit_jobs_ext, there's a dma_fence_put, so the bad job
is put one more time than other jobs.

[How]
Adding dma_fence_get before resbumit job in
amdgpu_device_recheck_guilty_jobs and put the fence for normal jobs

Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c