shell.te 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. typeattribute shell coredomain;
  2. # allow shell input injection
  3. allow shell uhid_device:chr_file rw_file_perms;
  4. # systrace support - allow atrace to run
  5. allow shell debugfs_tracing_debug:dir r_dir_perms;
  6. allow shell debugfs_tracing:dir r_dir_perms;
  7. allow shell debugfs_tracing:file rw_file_perms;
  8. allow shell debugfs_trace_marker:file getattr;
  9. allow shell atrace_exec:file rx_file_perms;
  10. userdebug_or_eng(`
  11. allow shell debugfs_tracing_debug:file rw_file_perms;
  12. ')
  13. # read config.gz for CTS purposes
  14. allow shell config_gz:file r_file_perms;
  15. # Run app_process.
  16. # XXX Transition into its own domain?
  17. app_domain(shell)
  18. # allow shell to call dumpsys storaged
  19. binder_call(shell, storaged)
  20. # Perform SELinux access checks, needed for CTS
  21. selinux_check_access(shell)
  22. selinux_check_context(shell)
  23. # Control Perfetto traced and obtain traces from it.
  24. # Needed for Studio and debugging.
  25. unix_socket_connect(shell, traced_consumer, traced)
  26. # Allow shell binaries to write trace data to Perfetto. Used for testing and
  27. # cmdline utils.
  28. allow shell traced:fd use;
  29. allow shell traced_tmpfs:file { read write getattr map };
  30. unix_socket_connect(shell, traced_producer, traced)
  31. domain_auto_trans(shell, vendor_shell_exec, vendor_shell)
  32. # Allow shell binaries to exec the perfetto cmdline util and have that
  33. # transition into its own domain, so that it behaves consistently to
  34. # when exec()-d by statsd.
  35. domain_auto_trans(shell, perfetto_exec, perfetto)
  36. # Allow to send SIGINT to perfetto when daemonized.
  37. allow shell perfetto:process signal;
  38. # Allow shell to run adb shell cmd stats commands. Needed for CTS.
  39. binder_call(shell, statsd);
  40. # Allow shell to read and unlink traces stored in /data/misc/perfetto-traces.
  41. allow shell perfetto_traces_data_file:dir rw_dir_perms;
  42. allow shell perfetto_traces_data_file:file { r_file_perms unlink };
  43. # Allow shell to run adb shell cmd gpu commands.
  44. binder_call(shell, gpuservice);
  45. # Allow shell to use atrace HAL
  46. hal_client_domain(shell, hal_atrace)
  47. # For hostside tests such as CTS listening ports test.
  48. allow shell proc_net_tcp_udp:file r_file_perms;
  49. # The dl.exec_linker* tests need to execute /system/bin/linker
  50. # b/124789393
  51. allow shell system_linker_exec:file rx_file_perms;
  52. # Renderscript host side tests depend on being able to execute
  53. # /system/bin/bcc (b/126388046)
  54. allow shell rs_exec:file rx_file_perms;
  55. # Allow shell to start and comminicate with lpdumpd.
  56. set_prop(shell, lpdumpd_prop);
  57. binder_call(shell, lpdumpd)