drm/amdkfd: fix potential kgd_mem UAFs
authorChia-I Wu <olvaffe@gmail.com>
Wed, 8 Mar 2023 21:37:24 +0000 (13:37 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Mar 2023 21:27:48 +0000 (17:27 -0400)
commit629fcf0b687e3244f4bc1ab0070074f836703b09
tree77dfaceb2ce33eddd1d824701f7ac6ee102d3929
parent22f1482aff4aee39e5f3354808bc099084c2b64b
drm/amdkfd: fix potential kgd_mem UAFs

kgd_mem pointers returned by kfd_process_device_translate_handle are
only guaranteed to be valid while p->mutex is held. As soon as the mutex
is unlocked, another thread can free the BO.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c