diff options
author | YuBiao Wang <YuBiao.Wang@amd.com> | 2022-08-24 10:56:04 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-08-31 00:00:03 +0300 |
commit | 3c93603d9568c7c4b20ff1712ddc60e997d78df7 (patch) | |
tree | f64cd7881ec0d07cef4560718494a58c89bb413a /tools/perf/scripts/python/export-to-postgresql.py | |
parent | d1b4a51a4ca8954f30cf4671b25c4f8637c45600 (diff) | |
download | linux-3c93603d9568c7c4b20ff1712ddc60e997d78df7.tar.xz |
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>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions