Files
linux/drivers/gpu/drm/amd/amdgpu
YuBiao Wang 2581c5d85e drm/amdgpu: Fix use-after-free in amdgpu_cs_ioctl
[Why]
In amdgpu_cs_ioctl, amdgpu_job_free could be performed ealier if there
is -ERESTARTSYS error. In this case, job->hw_fence could be not
initialized yet. Putting hw_fence during amdgpu_job_free could lead to a
use-after-free warning.

[How]
Check if drm_sched_job_init is performed before job_free by checking
s_fence.

v2: Check hw_fence.ops instead since it could be NULL if fence is not
initialized. Reverse the condition since !=NULL check is discouraged in
kernel.

Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-08-29 17:45:36 -04:00
..
2022-05-26 14:56:32 -04:00
2022-03-25 12:40:51 -04:00
2022-04-07 12:53:54 +02:00
2022-08-16 18:14:31 -04:00
2022-04-25 11:17:45 +02:00
2021-05-19 23:50:27 -04:00
2022-08-16 18:14:31 -04:00
2022-01-19 22:32:47 -05:00
2022-05-04 09:53:12 -04:00
2022-05-04 10:43:54 -04:00
2022-05-10 17:53:11 -04:00
2021-10-20 11:43:57 -04:00
2022-03-22 10:53:39 -04:00
2021-05-19 23:50:27 -04:00
2021-10-20 11:43:57 -04:00
2020-08-14 16:22:39 -04:00