Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 1 | typeattribute incident coredomain; |
| 2 | |
Nick Kralevich | 5e37271 | 2018-09-27 10:21:37 -0700 | [diff] [blame] | 3 | type incident_exec, system_file_type, exec_type, file_type; |
Joe Onorato | 41f93db | 2016-11-20 23:23:04 -0800 | [diff] [blame] | 4 | |
| 5 | # switch to incident domain for incident command |
| 6 | domain_auto_trans(shell, incident_exec, incident) |
Mike Ma | 62dc948 | 2019-08-21 14:58:13 -0700 | [diff] [blame] | 7 | domain_auto_trans(dumpstate, incident_exec, incident) |
Joe Onorato | 41f93db | 2016-11-20 23:23:04 -0800 | [diff] [blame] | 8 | |
| 9 | # allow incident access to stdout from its parent shell. |
| 10 | allow incident shell:fd use; |
| 11 | |
Mike Ma | 62dc948 | 2019-08-21 14:58:13 -0700 | [diff] [blame] | 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 | |
Yi Jin | 1002de4 | 2018-01-31 12:33:57 -0800 | [diff] [blame] | 18 | # allow incident be able to output data for CTS to fetch. |
| 19 | allow incident devpts:chr_file { read write }; |
| 20 | |
Joe Onorato | 41f93db | 2016-11-20 23:23:04 -0800 | [diff] [blame] | 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 | |
Mike Ma | 62dc948 | 2019-08-21 14:58:13 -0700 | [diff] [blame] | 36 | # only allow incident being called by shell or dumpstate |
Paul Lawrence | 840b607 | 2025-01-28 07:41:05 -0800 | [diff] [blame] | 37 | neverallow { |
| 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 | }; |