performanced.te 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # performanced
  2. type performanced, domain, mlstrustedsubject;
  3. type performanced_exec, system_file_type, exec_type, file_type;
  4. # Needed to check for app permissions.
  5. binder_use(performanced)
  6. binder_call(performanced, system_server)
  7. allow performanced permission_service:service_manager find;
  8. pdx_server(performanced, performance_client)
  9. # TODO: use file caps to obtain sys_nice instead of setuid / setgid.
  10. allow performanced self:global_capability_class_set { setuid setgid sys_nice };
  11. # Access /proc to validate we're only affecting threads in the same thread group.
  12. # Performanced also shields unbound kernel threads. It scans every task in the
  13. # root cpu set, but only affects the kernel threads.
  14. r_dir_file(performanced, { appdomain bufferhubd kernel surfaceflinger })
  15. dontaudit performanced domain:dir read;
  16. allow performanced { appdomain bufferhubd kernel surfaceflinger }:process setsched;
  17. # These /proc accesses only show up in permissive mode but they
  18. # generate a lot of noise in the log.
  19. userdebug_or_eng(`
  20. dontaudit performanced domain:dir open;
  21. dontaudit performanced domain:file { open read getattr };
  22. ')
  23. # Access /dev/cpuset/cpuset.cpus
  24. r_dir_file(performanced, cgroup)