2017-03-23 22:27:32 +01:00
|
|
|
typeattribute dumpstate coredomain;
|
2021-01-07 18:12:21 +01:00
|
|
|
type dumpstate_tmpfs, file_type;
|
2017-03-23 22:27:32 +01:00
|
|
|
|
2016-07-22 22:13:11 +02:00
|
|
|
init_daemon_domain(dumpstate)
|
|
|
|
|
|
|
|
# Execute and transition to the vdc domain
|
|
|
|
domain_auto_trans(dumpstate, vdc_exec, vdc)
|
2016-10-12 23:58:09 +02:00
|
|
|
|
2022-02-12 22:52:39 +01:00
|
|
|
# Create tmpfs files for using memfd descriptors to get output from child
|
|
|
|
# processes.
|
|
|
|
tmpfs_domain(dumpstate)
|
|
|
|
|
2017-04-25 04:53:51 +02:00
|
|
|
# Acquire advisory lock on /system/etc/xtables.lock from ip[6]tables
|
|
|
|
allow dumpstate system_file:file lock;
|
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
allow dumpstate storaged_exec:file rx_file_perms;
|
|
|
|
|
2021-02-09 21:03:40 +01:00
|
|
|
# /data/misc/a11ytrace for accessibility traces
|
|
|
|
userdebug_or_eng(`
|
|
|
|
allow dumpstate accessibility_trace_data_file:dir r_dir_perms;
|
|
|
|
allow dumpstate accessibility_trace_data_file:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2017-11-17 17:23:32 +01:00
|
|
|
# /data/misc/wmtrace for wm traces
|
|
|
|
userdebug_or_eng(`
|
|
|
|
allow dumpstate wm_trace_data_file:dir r_dir_perms;
|
|
|
|
allow dumpstate wm_trace_data_file:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2018-12-03 19:35:40 +01:00
|
|
|
# Allow dumpstate to make binder calls to incidentd
|
|
|
|
binder_call(dumpstate, incidentd)
|
|
|
|
|
2016-07-01 21:18:54 +02:00
|
|
|
# Allow dumpstate to make binder calls to storaged service
|
|
|
|
binder_call(dumpstate, storaged)
|
2017-03-03 22:13:25 +01:00
|
|
|
|
2018-01-18 01:17:28 +01:00
|
|
|
# Allow dumpstate to make binder calls to statsd
|
|
|
|
binder_call(dumpstate, statsd)
|
|
|
|
|
2018-11-13 21:35:17 +01:00
|
|
|
# Allow dumpstate to talk to gpuservice over binder
|
|
|
|
binder_call(dumpstate, gpuservice);
|
|
|
|
|
2018-12-05 20:01:04 +01:00
|
|
|
# Allow dumpstate to talk to idmap over binder
|
|
|
|
binder_call(dumpstate, idmap);
|
|
|
|
|
2020-11-10 07:12:38 +01:00
|
|
|
# Allow dumpstate to talk to profcollectd over binder
|
|
|
|
userdebug_or_eng(`
|
|
|
|
binder_call(dumpstate, profcollectd)
|
|
|
|
')
|
|
|
|
|
2017-03-03 22:13:25 +01:00
|
|
|
# Collect metrics on boot time created by init
|
|
|
|
get_prop(dumpstate, boottime_prop)
|
2018-01-25 02:56:25 +01:00
|
|
|
|
|
|
|
# Signal native processes to dump their stack.
|
|
|
|
allow dumpstate {
|
2020-10-15 21:38:30 +02:00
|
|
|
mediatranscoding
|
2018-01-25 02:56:25 +01:00
|
|
|
statsd
|
2019-04-05 10:33:56 +02:00
|
|
|
netd
|
2018-01-25 02:56:25 +01:00
|
|
|
}:process signal;
|
2018-02-14 23:32:38 +01:00
|
|
|
|
2021-05-05 05:59:32 +02:00
|
|
|
userdebug_or_eng(`
|
|
|
|
allow dumpstate keystore:process signal;
|
|
|
|
')
|
|
|
|
|
2018-02-14 23:32:38 +01:00
|
|
|
# For collecting bugreports.
|
2021-05-05 07:01:51 +02:00
|
|
|
no_debugfs_restriction(`
|
|
|
|
allow dumpstate debugfs_wakeup_sources:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2018-02-14 23:32:38 +01:00
|
|
|
allow dumpstate dev_type:blk_file getattr;
|
|
|
|
allow dumpstate webview_zygote:process signal;
|
2021-01-11 06:09:37 +01:00
|
|
|
allow dumpstate sysfs_dmabuf_stats:file r_file_perms;
|
2018-02-14 23:32:38 +01:00
|
|
|
dontaudit dumpstate update_engine:binder call;
|
2020-12-03 01:04:12 +01:00
|
|
|
|
|
|
|
# Read files in /proc
|
|
|
|
allow dumpstate {
|
|
|
|
proc_net_tcp_udp
|
|
|
|
proc_pid_max
|
|
|
|
}:file r_file_perms;
|
2018-12-08 02:20:14 +01:00
|
|
|
|
|
|
|
# For comminucating with the system process to do confirmation ui.
|
|
|
|
binder_call(dumpstate, incidentcompanion_service)
|
2019-09-06 23:52:21 +02:00
|
|
|
|
2020-03-04 09:20:35 +01:00
|
|
|
# Set properties.
|
|
|
|
# dumpstate_prop is used to share state with the Shell app.
|
|
|
|
set_prop(dumpstate, dumpstate_prop)
|
|
|
|
set_prop(dumpstate, exported_dumpstate_prop)
|
|
|
|
|
|
|
|
# dumpstate_options_prop is used to pass extra command-line args.
|
|
|
|
set_prop(dumpstate, dumpstate_options_prop)
|
|
|
|
|
|
|
|
# Allow dumpstate to kill vendor dumpstate service by init
|
|
|
|
set_prop(dumpstate, ctl_dumpstate_prop)
|
|
|
|
|
2019-09-06 23:52:21 +02:00
|
|
|
# For dumping dynamic partition information.
|
|
|
|
set_prop(dumpstate, lpdumpd_prop)
|
|
|
|
binder_call(dumpstate, lpdumpd)
|
2019-09-10 02:52:06 +02:00
|
|
|
|
2021-10-01 21:11:36 +02:00
|
|
|
# For dumping hypervisor information.
|
|
|
|
get_prop(dumpstate, hypervisor_prop)
|
|
|
|
|
2019-09-10 02:52:06 +02:00
|
|
|
# For dumping device-mapper and snapshot information.
|
|
|
|
allow dumpstate gsid_exec:file rx_file_perms;
|
|
|
|
set_prop(dumpstate, ctl_gsid_prop)
|
|
|
|
binder_call(dumpstate, gsid)
|
2019-10-29 22:12:16 +01:00
|
|
|
|
|
|
|
r_dir_file(dumpstate, ota_metadata_file)
|
2021-01-07 18:12:21 +01:00
|
|
|
|
|
|
|
# For starting (and killing) perfetto --save-for-bugreport. If a labelled trace
|
|
|
|
# is being recorded, the command above will serialize it into
|
|
|
|
# /data/misc/perfetto-traces/bugreport/*.pftrace .
|
|
|
|
domain_auto_trans(dumpstate, perfetto_exec, perfetto)
|
|
|
|
allow dumpstate perfetto:process signal;
|
|
|
|
allow dumpstate perfetto_traces_data_file:dir { search };
|
|
|
|
allow dumpstate perfetto_traces_bugreport_data_file:dir rw_dir_perms;
|
|
|
|
allow dumpstate perfetto_traces_bugreport_data_file:file { r_file_perms unlink };
|
|
|
|
|
|
|
|
# When exec-ing /system/bin/perfetto, dumpstates redirects stdio to /dev/null
|
|
|
|
# (which is labelled as dumpstate_tmpfs) to avoid leaking a FD to the bugreport
|
|
|
|
# zip file. These rules are to allow perfetto.te to inherit dumpstate's
|
|
|
|
# /dev/null.
|
|
|
|
allow perfetto dumpstate_tmpfs:file rw_file_perms;
|
|
|
|
allow perfetto dumpstate:fd use;
|
2022-03-11 22:21:57 +01:00
|
|
|
|
|
|
|
# system_dlkm_file for /system_dlkm partition
|
|
|
|
allow dumpstate system_dlkm_file:dir getattr;
|