From: Steven Price <steven.price@arm.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Jonathan Corbet" <corbet@lwn.net>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Liviu Dudau" <liviu.dudau@arm.com>
Cc: kernel@collabora.com, Tvrtko Ursulin <tursulin@ursulin.net>,
Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 5/5] drm/panthor: Fix race condition when gathering fdinfo group samples
Date: Fri, 24 Jan 2025 16:18:45 +0000 [thread overview]
Message-ID: <2500738a-5251-4f30-b36a-44dbfcaf0a84@arm.com> (raw)
In-Reply-To: <20250123225325.3271764-6-adrian.larumbe@collabora.com>
On 23/01/2025 22:53, Adrián Larumbe wrote:
> Commit e16635d88fa0 ("drm/panthor: add DRM fdinfo support") failed to
> protect access to groups with an xarray lock, which could lead to
> use-after-free errors.
>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
> Fixes: e16635d88fa0 ("drm/panthor: add DRM fdinfo support")
Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index e6c08a694e41..1d283b4bab86 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -2865,6 +2865,7 @@ void panthor_fdinfo_gather_group_samples(struct panthor_file *pfile)
> if (IS_ERR_OR_NULL(gpool))
> return;
>
> + xa_lock(&gpool->xa);
> xa_for_each(&gpool->xa, i, group) {
> mutex_lock(&group->fdinfo.lock);
> pfile->stats.cycles += group->fdinfo.data.cycles;
> @@ -2873,6 +2874,7 @@ void panthor_fdinfo_gather_group_samples(struct panthor_file *pfile)
> group->fdinfo.data.time = 0;
> mutex_unlock(&group->fdinfo.lock);
> }
> + xa_unlock(&gpool->xa);
> }
>
> static void group_sync_upd_work(struct work_struct *work)
prev parent reply other threads:[~2025-01-24 16:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 22:52 [PATCH v9 0/5] drm/panthor: Display size of internal kernel BOs through fdinfo Adrián Larumbe
2025-01-23 22:52 ` [PATCH v9 1/5] Documentation/gpu: Clarify format of driver-specific fidnfo keys Adrián Larumbe
2025-01-23 22:52 ` [PATCH v9 2/5] drm/file: Add fdinfo helper for printing regions with prefix Adrián Larumbe
2025-01-23 22:53 ` [PATCH v9 3/5] drm/panthor: Expose size of driver internal BO's over fdinfo Adrián Larumbe
2025-01-24 8:48 ` Boris Brezillon
2025-01-24 9:07 ` Boris Brezillon
2025-01-24 12:06 ` kernel test robot
2025-01-23 22:53 ` [PATCH v9 4/5] Documentation/gpu: Add fdinfo meanings of panthor-*-memory tags Adrián Larumbe
2025-01-23 22:53 ` [PATCH v9 5/5] drm/panthor: Fix race condition when gathering fdinfo group samples Adrián Larumbe
2025-01-24 9:06 ` Boris Brezillon
2025-01-24 16:18 ` Steven Price [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=2500738a-5251-4f30-b36a-44dbfcaf0a84@arm.com \
--to=steven.price@arm.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tursulin@ursulin.net \
--cc=tvrtko.ursulin@igalia.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®