simpleperf_app_runner.te 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. type simpleperf_app_runner, domain, mlstrustedsubject;
  2. type simpleperf_app_runner_exec, system_file_type, exec_type, file_type;
  3. # run simpleperf_app_runner in adb shell.
  4. allow simpleperf_app_runner adbd:fd use;
  5. allow simpleperf_app_runner shell:fd use;
  6. allow simpleperf_app_runner devpts:chr_file { read write ioctl };
  7. # simpleperf_app_runner reads package information.
  8. allow simpleperf_app_runner system_data_file:file r_file_perms;
  9. allow simpleperf_app_runner system_data_file:lnk_file getattr;
  10. allow simpleperf_app_runner packages_list_file:file r_file_perms;
  11. # The app's data dir may be accessed through a symlink.
  12. allow simpleperf_app_runner system_data_file:lnk_file read;
  13. # simpleperf_app_runner switches to the app UID/GID.
  14. allow simpleperf_app_runner self:global_capability_class_set { setuid setgid };
  15. # simpleperf_app_runner switches to the app security context.
  16. selinux_check_context(simpleperf_app_runner) # validate context
  17. allow simpleperf_app_runner self:process setcurrent;
  18. allow simpleperf_app_runner untrusted_app_all:process dyntransition; # setcon
  19. # simpleperf_app_runner/libselinux needs access to seapp_contexts_file to
  20. # determine which domain to transition to.
  21. allow simpleperf_app_runner seapp_contexts_file:file r_file_perms;
  22. # simpleperf_app_runner passes pipe fds.
  23. allow simpleperf_app_runner shell:fifo_file read;
  24. # simpleperf_app_runner checks shell data paths.
  25. # simpleperf_app_runner passes shell data fds.
  26. allow simpleperf_app_runner shell_data_file:dir { getattr search };
  27. allow simpleperf_app_runner shell_data_file:file { getattr write };
  28. ###
  29. ### neverallow rules
  30. ###
  31. # simpleperf_app_runner cannot have capabilities other than CAP_SETUID and CAP_SETGID
  32. neverallow simpleperf_app_runner self:global_capability_class_set ~{ setuid setgid };
  33. neverallow simpleperf_app_runner self:global_capability2_class_set *;