2017-03-23 14:27:32 -07:00
|
|
|
typeattribute shell coredomain;
|
|
|
|
|
2017-05-10 19:37:06 -07:00
|
|
|
# allow shell input injection
|
|
|
|
allow shell uhid_device:chr_file rw_file_perms;
|
|
|
|
|
2016-10-12 14:58:09 -07:00
|
|
|
# systrace support - allow atrace to run
|
2018-01-30 18:14:45 -08:00
|
|
|
allow shell debugfs_tracing_debug:dir r_dir_perms;
|
2016-10-12 14:58:09 -07:00
|
|
|
allow shell debugfs_tracing:dir r_dir_perms;
|
2017-07-26 16:22:50 -07:00
|
|
|
allow shell debugfs_tracing:file rw_file_perms;
|
2016-10-12 14:58:09 -07:00
|
|
|
allow shell debugfs_trace_marker:file getattr;
|
|
|
|
allow shell atrace_exec:file rx_file_perms;
|
|
|
|
|
2017-04-14 12:12:50 -07:00
|
|
|
userdebug_or_eng(`
|
2017-07-27 09:50:25 -07:00
|
|
|
allow shell debugfs_tracing_debug:file rw_file_perms;
|
2017-04-14 12:12:50 -07:00
|
|
|
')
|
|
|
|
|
2018-01-30 18:14:45 -08:00
|
|
|
# read config.gz for CTS purposes
|
|
|
|
allow shell config_gz:file r_file_perms;
|
|
|
|
|
2016-12-08 11:23:34 -08:00
|
|
|
# Run app_process.
|
|
|
|
# XXX Transition into its own domain?
|
|
|
|
app_domain(shell)
|
2017-03-23 12:28:20 -07:00
|
|
|
|
|
|
|
# allow shell to call dumpsys storaged
|
|
|
|
binder_call(shell, storaged)
|
2017-05-08 09:51:59 -07:00
|
|
|
|
|
|
|
# Perform SELinux access checks, needed for CTS
|
|
|
|
selinux_check_access(shell)
|
|
|
|
selinux_check_context(shell)
|
2017-12-20 18:51:15 -08: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.
|
2019-10-08 08:15:14 -07:00
|
|
|
perfetto_producer(shell)
|
2018-01-11 11:01:30 -08:00
|
|
|
|
|
|
|
domain_auto_trans(shell, vendor_shell_exec, vendor_shell)
|
2018-01-24 08:07:09 -08: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)
|
2018-12-06 05:28:01 -08:00
|
|
|
# Allow to send SIGINT to perfetto when daemonized.
|
|
|
|
allow shell perfetto:process signal;
|
2018-01-24 08:07:09 -08:00
|
|
|
|
2018-02-13 09:33:36 -08:00
|
|
|
# Allow shell to run adb shell cmd stats commands. Needed for CTS.
|
|
|
|
binder_call(shell, statsd);
|
|
|
|
|
2018-01-24 08:07:09 -08:00
|
|
|
# Allow shell to read and unlink traces stored in /data/misc/perfetto-traces.
|
|
|
|
allow shell perfetto_traces_data_file:dir rw_dir_perms;
|
2019-09-30 03:09:45 -07:00
|
|
|
allow shell perfetto_traces_data_file:file { r_file_perms unlink };
|
2018-09-17 17:06:19 -07:00
|
|
|
|
2018-11-27 15:21:43 -08:00
|
|
|
# Allow shell to run adb shell cmd gpu commands.
|
|
|
|
binder_call(shell, gpuservice);
|
|
|
|
|
2018-09-19 16:06:28 -07:00
|
|
|
# Allow shell to use atrace HAL
|
|
|
|
hal_client_domain(shell, hal_atrace)
|
2018-09-28 10:55:14 -07:00
|
|
|
|
|
|
|
# For hostside tests such as CTS listening ports test.
|
|
|
|
allow shell proc_net_tcp_udp:file r_file_perms;
|
2019-02-25 15:11:40 -08:00
|
|
|
|
|
|
|
# The dl.exec_linker* tests need to execute /system/bin/linker
|
|
|
|
# b/124789393
|
|
|
|
allow shell system_linker_exec:file rx_file_perms;
|
2019-02-26 12:30:42 -08:00
|
|
|
|
|
|
|
# Renderscript host side tests depend on being able to execute
|
|
|
|
# /system/bin/bcc (b/126388046)
|
|
|
|
allow shell rs_exec:file rx_file_perms;
|
2019-03-14 15:45:03 -07:00
|
|
|
|
|
|
|
# Allow shell to start and comminicate with lpdumpd.
|
|
|
|
set_prop(shell, lpdumpd_prop);
|
|
|
|
binder_call(shell, lpdumpd)
|
2019-08-08 22:20:34 -07:00
|
|
|
|
|
|
|
# Allow shell to set linker property
|
|
|
|
userdebug_or_eng(`
|
|
|
|
set_prop(shell, linker_prop)
|
|
|
|
')
|
2019-09-27 13:33:27 -07:00
|
|
|
|
|
|
|
# Allow shell to get encryption policy of /data/local/tmp/, for CTS
|
|
|
|
allowxperm shell shell_data_file:dir ioctl {
|
|
|
|
FS_IOC_GET_ENCRYPTION_POLICY
|
|
|
|
FS_IOC_GET_ENCRYPTION_POLICY_EX
|
|
|
|
};
|