blob: 19db7d752b311ae5a06a02f1dce5693f3c269d28 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute incident coredomain;
2
Nick Kralevich5e372712018-09-27 10:21:37 -07003type incident_exec, system_file_type, exec_type, file_type;
Joe Onorato41f93db2016-11-20 23:23:04 -08004
5# switch to incident domain for incident command
6domain_auto_trans(shell, incident_exec, incident)
Mike Ma62dc9482019-08-21 14:58:13 -07007domain_auto_trans(dumpstate, incident_exec, incident)
Joe Onorato41f93db2016-11-20 23:23:04 -08008
9# allow incident access to stdout from its parent shell.
10allow incident shell:fd use;
11
Mike Ma62dc9482019-08-21 14:58:13 -070012# allow incident to communicate with dumpstate, and write incident report to
13# /data/data/com.android.shell/files/bugreports/tmp_incident_report
14allow incident dumpstate:fd use;
15allow incident dumpstate:unix_stream_socket { read write };
16allow incident shell_data_file:file write;
17
Yi Jin1002de42018-01-31 12:33:57 -080018# allow incident be able to output data for CTS to fetch.
19allow incident devpts:chr_file { read write };
20
Joe Onorato41f93db2016-11-20 23:23:04 -080021# allow incident to communicate use, read and write over the adb
22# connection.
23allow incident adbd:fd use;
24allow incident adbd:unix_stream_socket { read write };
25
26# allow adbd to reap incident
27allow incident adbd:process { sigchld };
28
29# Allow the incident command to talk to the incidentd over the binder, and get
30# back the incident report data from a ParcelFileDescriptor.
31binder_use(incident)
32allow incident incident_service:service_manager find;
33binder_call(incident, incidentd)
34allow incident incidentd:fifo_file write;
35
Mike Ma62dc9482019-08-21 14:58:13 -070036# only allow incident being called by shell or dumpstate
Paul Lawrence840b6072025-01-28 07:41:05 -080037neverallow {
38 domain
39 -su
40 -shell
41 -incident
42 -dumpstate
43 userdebug_or_eng(`-overlay_remounter')
44} incident_exec:file {
45 execute
46 execute_no_trans
47};