From: "Christian König" <christian.koenig@amd.com>
To: Min Li <lm0963hack@gmail.com>, alexander.deucher@amd.com
Cc: Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
airlied@gmail.com, sumit.semwal@linaro.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
Date: Thu, 1 Jun 2023 16:34:01 +0200 [thread overview]
Message-ID: <81371d0d-5093-5aa8-f757-2f11f24366eb@amd.com> (raw)
In-Reply-To: <20230526123753.16160-1-lm0963hack@gmail.com>
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@gmail.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;
> }
>
prev parent reply other threads:[~2023-06-01 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 12:37 [PATCH] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl Min Li
2023-05-27 11:06 ` kernel test robot
2023-05-27 16:12 ` kernel test robot
2023-06-01 14:34 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81371d0d-5093-5aa8-f757-2f11f24366eb@amd.com \
--to=christian.koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lm0963hack@gmail.com \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox