Files
device_google_wahoo/sepolicy/perfd.te
Max Bires 3d06ccc559 Adding allows to fix perfd and setup_wizard denials
denied { read write } for pid=1361 comm="Binder:1361_4" name="sdd4"
dev="tmpfs" ino=10187 scontext=u:r:system_server:s0
tcontext=u:object_r:block_device:s0 tclass=blk_file

denied { write } for pid=805 comm="perfd" name="scaling_min_freq"
dev="sysfs" ino=29879 scontext=u:r:perfd:s0
tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file

Test: Startup wizard no longer crashes a few times before working
Change-Id: I85425e00d1b834d0775ec940befec4ecee514df7
2017-04-24 23:24:20 +00:00

40 lines
1.4 KiB
Plaintext

type perfd, domain;
type perfd_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(perfd)
r_dir_file(perfd, sysfs_msm_subsys)
# perfd uses kill(pid, 0) to determine if a process exists.
# Determining if a process exists does not require the kill capability
# since a permission denied indicates the process exists.
dontaudit perfd self:capability kill;
allow perfd mediacodec:process signull;
allow perfd cgroup:file r_file_perms;
allow perfd post_boot_prop:file r_file_perms;
allow perfd proc:file rw_file_perms;
allow perfd sysfs_soc:dir search;
allow perfd sysfs_soc:file r_file_perms;
allow perfd sysfs_msm_subsys:file w_file_perms;
allow perfd sysfs_devices_system_cpu:file w_file_perms;
allow perfd perfd_socket:sock_file write;
allow perfd latency_device:chr_file w_file_perms;
userdebug_or_eng(`
permissive perfd;
')
# TODO(b/34274385): Remove this once HALs are guaranteed to not be run in passthrough mode
# What's going on here is that Audio HAL, Power and DRM HAL are talking over sockets to perfd,
# which is permitted. However, those rules target hal_x rather than hal_x_server and thus are also
# granted to all clients of these HALs (e.g., system_server) which are core components, and
# socket communications between system components and vendor components are not permted.
# Once we switch full Treble devices to binderized only mode, this issue will disappear.
typeattribute perfd socket_between_core_and_vendor_violators;