mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-13 19:33:51 -04:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user