blob: f418fa3f859134089c655b0eb9aa4fdc305b70d9 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute dumpstate coredomain;
Primiano Tucci2f998092021-01-07 17:12:21 +00002type dumpstate_tmpfs, file_type;
Alex Klyubinf5446eb2017-03-23 14:27:32 -07003
dcashmancc39f632016-07-22 13:13:11 -07004init_daemon_domain(dumpstate)
5
6# Execute and transition to the vdc domain
7domain_auto_trans(dumpstate, vdc_exec, vdc)
dcashman2e00e632016-10-12 14:58:09 -07008
Joel Scherpelz5e901bb2017-04-25 11:53:51 +09009# Acquire advisory lock on /system/etc/xtables.lock from ip[6]tables
10allow dumpstate system_file:file lock;
11
ynwange68d2d22016-07-01 12:18:54 -070012allow dumpstate storaged_exec:file rx_file_perms;
13
Hongming Jin58f83412021-02-09 12:03:40 -080014# /data/misc/a11ytrace for accessibility traces
15userdebug_or_eng(`
16 allow dumpstate accessibility_trace_data_file:dir r_dir_perms;
17 allow dumpstate accessibility_trace_data_file:file r_file_perms;
18')
19
Vishnu Nair2d6942d2017-11-17 08:23:32 -080020# /data/misc/wmtrace for wm traces
21userdebug_or_eng(`
22 allow dumpstate wm_trace_data_file:dir r_dir_perms;
23 allow dumpstate wm_trace_data_file:file r_file_perms;
24')
25
Mike Made3a3e42018-12-03 10:35:40 -080026# Allow dumpstate to make binder calls to incidentd
27binder_call(dumpstate, incidentd)
28
ynwange68d2d22016-07-01 12:18:54 -070029# Allow dumpstate to make binder calls to storaged service
30binder_call(dumpstate, storaged)
Keun-young Park43e8fae2017-03-03 13:13:25 -080031
Yao Chenb10ff332018-01-17 16:17:28 -080032# Allow dumpstate to make binder calls to statsd
33binder_call(dumpstate, statsd)
34
Joel Galenson7c275a62018-11-13 12:35:17 -080035# Allow dumpstate to talk to gpuservice over binder
36binder_call(dumpstate, gpuservice);
37
Joel Galenson657470a2018-12-05 11:01:04 -080038# Allow dumpstate to talk to idmap over binder
39binder_call(dumpstate, idmap);
40
Alex Hong906c7242020-11-10 14:12:38 +080041# Allow dumpstate to talk to profcollectd over binder
42userdebug_or_eng(`
43 binder_call(dumpstate, profcollectd)
44')
45
Keun-young Park43e8fae2017-03-03 13:13:25 -080046# Collect metrics on boot time created by init
47get_prop(dumpstate, boottime_prop)
Andreas Gampe7468db62018-01-24 17:56:25 -080048
49# Signal native processes to dump their stack.
50allow dumpstate {
Chong Zhang81f5b9f2020-10-15 12:38:30 -070051 mediatranscoding
Andreas Gampe7468db62018-01-24 17:56:25 -080052 statsd
Chalard Jeana4c9f7b2019-04-05 17:33:56 +090053 netd
Andreas Gampe7468db62018-01-24 17:56:25 -080054}:process signal;
Joel Galenson03ff9f92018-02-14 14:32:38 -080055
56# For collecting bugreports.
Hridya Valsarajua0b504a2021-03-24 16:40:15 -070057no_debugfs_restriction(`
58 allow dumpstate debugfs_wakeup_sources:file r_file_perms;
59')
60
Joel Galenson03ff9f92018-02-14 14:32:38 -080061allow dumpstate dev_type:blk_file getattr;
62allow dumpstate webview_zygote:process signal;
Hridya Valsaraju6217b662021-01-10 21:09:37 -080063allow dumpstate sysfs_dmabuf_stats:file r_file_perms;
Joel Galenson03ff9f92018-02-14 14:32:38 -080064dontaudit dumpstate update_engine:binder call;
Alistair Delva2bbf1ce2020-12-02 16:04:12 -080065
66# Read files in /proc
67allow dumpstate {
68 proc_net_tcp_udp
69 proc_pid_max
70}:file r_file_perms;
Joe Onorato5536a082018-12-07 17:20:14 -080071
72# For comminucating with the system process to do confirmation ui.
73binder_call(dumpstate, incidentcompanion_service)
David Andersondc2a7872019-09-06 14:52:21 -070074
Inseob Kim55e5c9b2020-03-04 17:20:35 +090075# Set properties.
76# dumpstate_prop is used to share state with the Shell app.
77set_prop(dumpstate, dumpstate_prop)
78set_prop(dumpstate, exported_dumpstate_prop)
79
80# dumpstate_options_prop is used to pass extra command-line args.
81set_prop(dumpstate, dumpstate_options_prop)
82
83# Allow dumpstate to kill vendor dumpstate service by init
84set_prop(dumpstate, ctl_dumpstate_prop)
85
David Andersondc2a7872019-09-06 14:52:21 -070086# For dumping dynamic partition information.
87set_prop(dumpstate, lpdumpd_prop)
88binder_call(dumpstate, lpdumpd)
David Anderson14eaa6c2019-09-09 17:52:06 -070089
90# For dumping device-mapper and snapshot information.
91allow dumpstate gsid_exec:file rx_file_perms;
92set_prop(dumpstate, ctl_gsid_prop)
93binder_call(dumpstate, gsid)
Yifan Hong91709db2019-10-29 14:12:16 -070094
95r_dir_file(dumpstate, ota_metadata_file)
Primiano Tucci2f998092021-01-07 17:12:21 +000096
97# For starting (and killing) perfetto --save-for-bugreport. If a labelled trace
98# is being recorded, the command above will serialize it into
99# /data/misc/perfetto-traces/bugreport/*.pftrace .
100domain_auto_trans(dumpstate, perfetto_exec, perfetto)
101allow dumpstate perfetto:process signal;
102allow dumpstate perfetto_traces_data_file:dir { search };
103allow dumpstate perfetto_traces_bugreport_data_file:dir rw_dir_perms;
104allow dumpstate perfetto_traces_bugreport_data_file:file { r_file_perms unlink };
105
106# When exec-ing /system/bin/perfetto, dumpstates redirects stdio to /dev/null
107# (which is labelled as dumpstate_tmpfs) to avoid leaking a FD to the bugreport
108# zip file. These rules are to allow perfetto.te to inherit dumpstate's
109# /dev/null.
110allow perfetto dumpstate_tmpfs:file rw_file_perms;
111allow perfetto dumpstate:fd use;