2017-03-23 22:27:32 +01:00
|
|
|
typeattribute shell coredomain;
|
|
|
|
|
2017-05-11 04:37:06 +02:00
|
|
|
# allow shell input injection
|
|
|
|
allow shell uhid_device:chr_file rw_file_perms;
|
|
|
|
|
2016-10-12 23:58:09 +02:00
|
|
|
# systrace support - allow atrace to run
|
|
|
|
allow shell debugfs_tracing:dir r_dir_perms;
|
2017-07-27 01:22:50 +02:00
|
|
|
allow shell debugfs_tracing:file rw_file_perms;
|
2016-10-12 23:58:09 +02:00
|
|
|
allow shell debugfs_trace_marker:file getattr;
|
|
|
|
allow shell atrace_exec:file rx_file_perms;
|
|
|
|
|
2017-05-08 23:38:45 +02:00
|
|
|
# read config.gz for CTS purposes
|
|
|
|
allow shell config_gz:file r_file_perms;
|
|
|
|
|
2017-04-14 21:12:50 +02:00
|
|
|
userdebug_or_eng(`
|
2017-07-27 18:50:25 +02:00
|
|
|
allow shell debugfs_tracing_debug:file rw_file_perms;
|
2017-04-14 21:12:50 +02:00
|
|
|
')
|
|
|
|
|
2016-12-08 20:23:34 +01:00
|
|
|
# Run app_process.
|
|
|
|
# XXX Transition into its own domain?
|
|
|
|
app_domain(shell)
|
2017-03-23 20:28:20 +01:00
|
|
|
|
|
|
|
# allow shell to call dumpsys storaged
|
|
|
|
binder_call(shell, storaged)
|
2017-05-08 18:51:59 +02:00
|
|
|
|
|
|
|
# Perform SELinux access checks, needed for CTS
|
|
|
|
selinux_check_access(shell)
|
|
|
|
selinux_check_context(shell)
|
2017-12-21 03:51:15 +01:00
|
|
|
|
|
|
|
# Control Perfetto traced and obtain traces from it.
|
|
|
|
# Needed for Studio and debugging.
|
|
|
|
unix_socket_connect(shell, traced_consumer, traced)
|
|
|
|
|
|
|
|
# Allow shell binaries to write trace data to Perfetto. Used for testing and
|
|
|
|
# cmdline utils.
|
|
|
|
allow shell traced:fd use;
|
|
|
|
allow shell traced_tmpfs:file { read write getattr map };
|
|
|
|
unix_socket_connect(shell, traced_producer, traced)
|
2018-01-11 20:01:30 +01:00
|
|
|
|
|
|
|
domain_auto_trans(shell, vendor_shell_exec, vendor_shell)
|
2018-01-24 17:07:09 +01:00
|
|
|
|
|
|
|
# Allow shell binaries to exec the perfetto cmdline util and have that
|
|
|
|
# transition into its own domain, so that it behaves consistently to
|
|
|
|
# when exec()-d by statsd.
|
|
|
|
domain_auto_trans(shell, perfetto_exec, perfetto)
|
|
|
|
|
|
|
|
# Allow shell to read and unlink traces stored in /data/misc/perfetto-traces.
|
|
|
|
allow shell perfetto_traces_data_file:dir rw_dir_perms;
|
|
|
|
allow shell perfetto_traces_data_file:file r_file_perms;
|