summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robin.clark@oss.qualcomm.com>2026-07-29 08:55:41 -0700
committerRob Clark <robin.clark@oss.qualcomm.com>2026-07-29 11:56:01 -0700
commit2b1bfcb59d3f9bd4ab37eb6747fc783c67a7f82b (patch)
tree31f6dbcf43959dfd27fbfc1d3d14796f41a751a4
parent2c26f9e46d39571a11ad8a6c3cdf150af70e4f12 (diff)
downloadlinux-2b1bfcb59d3f9bd4ab37eb6747fc783c67a7f82b.tar.gz
linux-2b1bfcb59d3f9bd4ab37eb6747fc783c67a7f82b.zip
drm/msm: Synchronize set_sysprof on ctxlock
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> Patchwork: https://patchwork.freedesktop.org/patch/743091/ Message-ID: <20260729155609.20190-5-robin.clark@oss.qualcomm.com>
-rw-r--r--drivers/gpu/drm/msm/msm_submitqueue.c2
1 files changed, 2 insertions, 0 deletions
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