blob: 02b01f5aee650b92676533150ab1fb0701b7c562 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute shell coredomain;
2
Siarhei Vishniakou2a7f5712017-05-10 19:37:06 -07003# allow shell input injection
4allow shell uhid_device:chr_file rw_file_perms;
5
dcashman2e00e632016-10-12 14:58:09 -07006# systrace support - allow atrace to run
Carmen Jackson2c8ca452018-01-30 18:14:45 -08007allow shell debugfs_tracing_debug:dir r_dir_perms;
dcashman2e00e632016-10-12 14:58:09 -07008allow shell debugfs_tracing:dir r_dir_perms;
Joel Galenson27c0aa72017-07-26 16:22:50 -07009allow shell debugfs_tracing:file rw_file_perms;
dcashman2e00e632016-10-12 14:58:09 -070010allow shell debugfs_trace_marker:file getattr;
11allow shell atrace_exec:file rx_file_perms;
12
Carmen Jackson25788df2017-04-14 12:12:50 -070013userdebug_or_eng(`
Joel Galenson47966ce2017-07-27 09:50:25 -070014 allow shell debugfs_tracing_debug:file rw_file_perms;
Carmen Jackson25788df2017-04-14 12:12:50 -070015')
16
Carmen Jackson2c8ca452018-01-30 18:14:45 -080017# read config.gz for CTS purposes
18allow shell config_gz:file r_file_perms;
19
dcashman3e8dbf02016-12-08 11:23:34 -080020# Run app_process.
21# XXX Transition into its own domain?
22app_domain(shell)
Jin Qiana239f302017-03-23 12:28:20 -070023
24# allow shell to call dumpsys storaged
25binder_call(shell, storaged)
Nick Kralevich14e2e922017-05-08 09:51:59 -070026
27# Perform SELinux access checks, needed for CTS
28selinux_check_access(shell)
29selinux_check_context(shell)
Primiano Tuccic80f9e02017-12-21 03:51:15 +010030
31# Control Perfetto traced and obtain traces from it.
32# Needed for Studio and debugging.
33unix_socket_connect(shell, traced_consumer, traced)
34
35# Allow shell binaries to write trace data to Perfetto. Used for testing and
36# cmdline utils.
37allow shell traced:fd use;
38allow shell traced_tmpfs:file { read write getattr map };
39unix_socket_connect(shell, traced_producer, traced)
Yifan Hong00ab5d82018-01-11 11:01:30 -080040
41domain_auto_trans(shell, vendor_shell_exec, vendor_shell)
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000042
43# Allow shell binaries to exec the perfetto cmdline util and have that
44# transition into its own domain, so that it behaves consistently to
45# when exec()-d by statsd.
46domain_auto_trans(shell, perfetto_exec, perfetto)
Florian Mayeraeca04b2018-12-06 13:28:01 +000047# Allow to send SIGINT to perfetto when daemonized.
48allow shell perfetto:process signal;
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000049
Bookatz022ab0e2018-02-13 09:33:36 -080050# Allow shell to run adb shell cmd stats commands. Needed for CTS.
51binder_call(shell, statsd);
52
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000053# Allow shell to read and unlink traces stored in /data/misc/perfetto-traces.
54allow shell perfetto_traces_data_file:dir rw_dir_perms;
55allow shell perfetto_traces_data_file:file r_file_perms;
Fan Xu26fa9142018-09-17 17:06:19 -070056
Yiwei Zhangff0f79c2018-11-27 15:21:43 -080057# Allow shell to run adb shell cmd gpu commands.
58binder_call(shell, gpuservice);
59
Wei Wangbc71a612018-09-19 16:06:28 -070060# Allow shell to use atrace HAL
61hal_client_domain(shell, hal_atrace)
Jeff Vander Stoep42451772018-09-28 10:55:14 -070062
63# For hostside tests such as CTS listening ports test.
64allow shell proc_net_tcp_udp:file r_file_perms;
Nick Kralevich905b4002019-02-25 15:11:40 -080065
66# The dl.exec_linker* tests need to execute /system/bin/linker
67# b/124789393
68allow shell system_linker_exec:file rx_file_perms;
Nick Kralevich68e27ca2019-02-26 12:30:42 -080069
70# Renderscript host side tests depend on being able to execute
71# /system/bin/bcc (b/126388046)
72allow shell rs_exec:file rx_file_perms;
Yifan Hong18ade862019-03-14 15:45:03 -070073
74# Allow shell to start and comminicate with lpdumpd.
75set_prop(shell, lpdumpd_prop);
76binder_call(shell, lpdumpd)