apparmor.d/apparmor.d/groups/freedesktop/cpupower
2024-10-01 17:43:54 +01:00

53 lines
1.5 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/cpupower
profile cpupower @{exec_path} {
include <abstractions/base>
# Needed to read the /dev/cpu/@{int}/msr device, and hence remove the following error:
# Could not read perf-bias value[-1]
capability sys_rawio,
# Needed to operate on CPU IDLE states
capability sys_admin,
@{exec_path} mr,
@{sh_path} rix,
@{bin}/kmod rCx -> kmod,
@{bin}/man rPx,
@{sys}/devices/system/cpu/{cpufreq,cpuidle}/ r,
@{sys}/devices/system/cpu/{cpufreq,cpuidle}/** r,
@{sys}/devices/system/cpu/cpu@{int}/{cpufreq,cpuidle}/ r,
@{sys}/devices/system/cpu/cpu@{int}/{cpufreq,cpuidle}/** r,
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_{min,max}_freq rw,
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_governor rw,
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_setspeed rw,
@{sys}/devices/system/cpu/cpu@{int}/cpuidle/state@{int}/disable rw,
@{sys}/devices/system/cpu/cpu@{int}/topology/{physical_package_id,core_id} r,
@{sys}/devices/system/cpu/cpu@{int}/online r,
/dev/cpu/@{int}/msr r,
profile kmod {
include <abstractions/base>
include <abstractions/app/kmod>
include if exists <local/cpupower_kmod>
}
include if exists <local/cpupower>
}
# vim:syntax=apparmor