Skip to content

Commit 4f3b77a

Browse files
lumagAbhinav Kumar
authored andcommitted
drm/msm/dpu: don't allow overriding data from catalog
The data from catalog is marked as const, so it is a part of the RO segment. Allowing userspace to write to it through debugfs can cause protection faults. Set debugfs file mode to read-only for debug entries corresponding to perf_cfg coming from catalog. Fixes: abda0d9 ("drm/msm/dpu: Mark various data tables as const") Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/582844/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent c588f7d commit 4f3b77a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,15 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent)
459459
&perf->core_clk_rate);
460460
debugfs_create_u32("enable_bw_release", 0600, entry,
461461
(u32 *)&perf->enable_bw_release);
462-
debugfs_create_u32("threshold_low", 0600, entry,
462+
debugfs_create_u32("threshold_low", 0400, entry,
463463
(u32 *)&perf->perf_cfg->max_bw_low);
464-
debugfs_create_u32("threshold_high", 0600, entry,
464+
debugfs_create_u32("threshold_high", 0400, entry,
465465
(u32 *)&perf->perf_cfg->max_bw_high);
466-
debugfs_create_u32("min_core_ib", 0600, entry,
466+
debugfs_create_u32("min_core_ib", 0400, entry,
467467
(u32 *)&perf->perf_cfg->min_core_ib);
468-
debugfs_create_u32("min_llcc_ib", 0600, entry,
468+
debugfs_create_u32("min_llcc_ib", 0400, entry,
469469
(u32 *)&perf->perf_cfg->min_llcc_ib);
470-
debugfs_create_u32("min_dram_ib", 0600, entry,
470+
debugfs_create_u32("min_dram_ib", 0400, entry,
471471
(u32 *)&perf->perf_cfg->min_dram_ib);
472472
debugfs_create_file("perf_mode", 0600, entry,
473473
(u32 *)perf, &dpu_core_perf_mode_fops);

0 commit comments

Comments
 (0)