drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
authorMin Li <lm0963hack@gmail.com>
Sat, 3 Jun 2023 07:43:45 +0000 (15:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:12:39 +0000 (11:12 +0200)
commit1af1cd7be370b08694d8752c97325fe51fdab6aa
treedec5ae7312afdaee839e3d72b1d4d8fc26dbb87e
parent022f2306d94f87defde366729938c5c54a3d12ff
drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

[ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ]

Userspace can race to free the gobj(robj converted from), robj should not
be accessed again after drm_gem_object_put, otherwith it will result in
use-after-free.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Min Li <lm0963hack@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/radeon/radeon_gem.c