From: Rob Clark <robin.clark@oss.qualcomm.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
Rob Clark <robin.clark@oss.qualcomm.com>,
Dmitry Baryshkov <lumag@kernel.org>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Jessica Zhang <jesszhan0024@gmail.com>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v7 04/17] drm/msm: Synchronize set_sysprof on ctxlock
Date: Wed, 29 Jul 2026 08:55:41 -0700 [thread overview]
Message-ID: <20260729155609.20190-5-robin.clark@oss.qualcomm.com> (raw)
In-Reply-To: <20260729155609.20190-1-robin.clark@oss.qualcomm.com>
A user that was perfmon_capable() could try to race setting SYSPROF
param on multiple threads to trigger a reference leak.
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_submitqueue.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c b/drivers/gpu/drm/msm/msm_submitqueue.c
index 8b5980d5a6a7..233c4f35ab12 100644
--- a/drivers/gpu/drm/msm/msm_submitqueue.c
+++ b/drivers/gpu/drm/msm/msm_submitqueue.c
@@ -9,6 +9,8 @@
int msm_context_set_sysprof(struct msm_context *ctx, struct msm_gpu *gpu, int sysprof)
{
+ guard(rwsem_write)(&ctx->ctxlock);
+
/*
* Since pm_runtime and sysprof_active are both refcounts, we
* call apply the new value first, and then unwind the previous
--
2.55.0
next prev parent reply other threads:[~2026-07-29 15:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 15:55 [PATCH v7 00/17] drm/msm: A couple lazy-vm fixes Rob Clark
2026-07-29 15:55 ` [PATCH v7 01/17] drm/msm: Fix barriers accessing ctx vm Rob Clark
2026-07-29 15:55 ` [PATCH v7 02/17] drm/msm: Rework queuelock Rob Clark
2026-07-29 15:55 ` [PATCH v7 03/17] drm/msm: Synchronize VM creation on ctxlock Rob Clark
2026-07-29 15:55 ` Rob Clark [this message]
2026-07-29 15:55 ` [PATCH v7 05/17] drm/msm: Move nr_cmds initialization Rob Clark
2026-07-29 15:55 ` [PATCH v7 06/17] drm/msm: Remove redundant SIZE_MAX check Rob Clark
2026-07-29 15:55 ` [PATCH v7 07/17] drm/msm/a6xx: Access VM directly in submit path Rob Clark
2026-07-29 15:55 ` [PATCH v7 08/17] drm/msm: Add helper to check for per-process pgtables VM Rob Clark
2026-07-29 15:55 ` [PATCH v7 09/17] drm/msm/gem: Fix dma_buf import error paths Rob Clark
2026-07-29 15:55 ` [PATCH v7 10/17] drm/msm/gem: Remove useless locking in GEM import Rob Clark
2026-07-29 15:55 ` [PATCH v7 11/17] drm/msm/gem: Extract bookkeeping init helper Rob Clark
2026-07-29 15:55 ` [PATCH v7 12/17] drm/msm/gem: Set resv before exposing obj Rob Clark
2026-07-29 15:55 ` [PATCH v7 13/17] drm/msm/gem: Validate lazy VM in GEM_NEW Rob Clark
2026-07-29 15:55 ` [PATCH v7 14/17] drm/msm: Allow lazy VM creation to fail Rob Clark
2026-07-29 15:55 ` [PATCH v7 15/17] drm/msm: Don't fallback to shared VM for VM_BIND Rob Clark
2026-07-29 15:55 ` [PATCH v7 16/17] drm/msm: Fix per-process-pgtables check Rob Clark
2026-07-29 15:55 ` [PATCH v7 17/17] drm/msm: Fixup invalid overflow check Rob Clark
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=20260729155609.20190-5-robin.clark@oss.qualcomm.com \
--to=robin.clark@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
/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®