Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame^] | 1 | typeattribute incident coredomain; |
| 2 | |
| 3 | type incident_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | # switch to incident domain for incident command |
| 6 | domain_auto_trans(shell, incident_exec, incident) |
| 7 | domain_auto_trans(dumpstate, incident_exec, incident) |
| 8 | |
| 9 | # allow incident access to stdout from its parent shell. |
| 10 | allow incident shell:fd use; |
| 11 | |
| 12 | # allow incident to communicate with dumpstate, and write incident report to |
| 13 | # /data/data/com.android.shell/files/bugreports/tmp_incident_report |
| 14 | allow incident dumpstate:fd use; |
| 15 | allow incident dumpstate:unix_stream_socket { read write }; |
| 16 | allow incident shell_data_file:file write; |
| 17 | |
| 18 | # allow incident be able to output data for CTS to fetch. |
| 19 | allow incident devpts:chr_file { read write }; |
| 20 | |
| 21 | # allow incident to communicate use, read and write over the adb |
| 22 | # connection. |
| 23 | allow incident adbd:fd use; |
| 24 | allow incident adbd:unix_stream_socket { read write }; |
| 25 | |
| 26 | # allow adbd to reap incident |
| 27 | allow 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. |
| 31 | binder_use(incident) |
| 32 | allow incident incident_service:service_manager find; |
| 33 | binder_call(incident, incidentd) |
| 34 | allow incident incidentd:fifo_file write; |
| 35 | |
| 36 | # only allow incident being called by shell or dumpstate |
| 37 | neverallow { domain -su -shell -incident -dumpstate} incident_exec:file { execute execute_no_trans }; |