Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: ISST: Check for admin capability for write commands

In some SST deployments, administrators want to allow reading SST
capabilities for non-root users. This can be achieved by changing file
permissions for "/dev/isst_interface", but they still want to prevent
any changes to the SST configuration by non-root users.

This capability was available before for non-TPMI SST. Extend the same
capability for TPMI SST by adding a check for CAP_SYS_ADMIN for all
write commands.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20260107060729.1634420-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Srinivas Pandruvada and committed by
Ilpo Järvinen
69cd1ca4 dc7901b5

+6 -5
+6 -5
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
··· 612 612 return -EINVAL; 613 613 614 614 if (core_power.get_set) { 615 - if (power_domain_info->write_blocked) 615 + if (power_domain_info->write_blocked || !capable(CAP_SYS_ADMIN)) 616 616 return -EPERM; 617 617 618 618 _write_cp_info("cp_enable", core_power.enable, SST_CP_CONTROL_OFFSET, ··· 659 659 return -EINVAL; 660 660 661 661 if (clos_param.get_set) { 662 - if (power_domain_info->write_blocked) 662 + if (power_domain_info->write_blocked || !capable(CAP_SYS_ADMIN)) 663 663 return -EPERM; 664 664 665 665 _write_cp_info("clos.min_freq", clos_param.min_freq_mhz, ··· 751 751 752 752 power_domain_info = &sst_inst->power_domain_info[part][punit_id]; 753 753 754 - if (assoc_cmds.get_set && power_domain_info->write_blocked) 754 + if (assoc_cmds.get_set && (power_domain_info->write_blocked || 755 + !capable(CAP_SYS_ADMIN))) 755 756 return -EPERM; 756 757 757 758 offset = SST_CLOS_ASSOC_0_OFFSET + ··· 929 928 if (!power_domain_info) 930 929 return -EINVAL; 931 930 932 - if (power_domain_info->write_blocked) 931 + if (power_domain_info->write_blocked || !capable(CAP_SYS_ADMIN)) 933 932 return -EPERM; 934 933 935 934 if (!(power_domain_info->pp_header.allowed_level_mask & BIT(perf_level.level))) ··· 989 988 if (!power_domain_info) 990 989 return -EINVAL; 991 990 992 - if (power_domain_info->write_blocked) 991 + if (power_domain_info->write_blocked || !capable(CAP_SYS_ADMIN)) 993 992 return -EPERM; 994 993 995 994 _write_pp_info("perf_feature", perf_feature.feature, SST_PP_CONTROL_OFFSET,