[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <81371d0d-5093-5aa8-f757-2f11f24366eb@amd.com>
Date: Thu, 1 Jun 2023 16:34:01 +0200
From: Christian König <christian.koenig@....com>
To: Min Li <lm0963hack@...il.com>, alexander.deucher@....com
Cc: Xinhui.Pan@....com, airlied@...il.com, daniel@...ll.ch,
sumit.semwal@...aro.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH] drm/radeon: fix race condition UAF in
radeon_gem_set_domain_ioctl
Am 26.05.23 um 14:37 schrieb Min Li:
> 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.
>
> Signed-off-by: Min Li <lm0963hack@...il.com>
> ---
> drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index bdc5af23f005..450c7cbdd28a 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -478,7 +478,7 @@ int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data,
>
> drm_gem_object_put(gobj);
> up_read(&rdev->exclusive_lock);
> - r = radeon_gem_handle_lockup(robj->rdev, r);
> + r = radeon_gem_handle_lockup(rdev, r);
This also makes the robj unused which the kernel test robot also
complained about.
Please remove that local variable and re-submit.
Apart from that the patch looks good to me,
Christian.
> return r;
> }
>
Powered by blists - more mailing lists