platform_system_sepolicy/private/atrace.te
Yifan Hong 18ade868ff Add rules for lpdump and lpdumpd
- lpdump is a binary on the device that talks to lpdumpd
  via binder.

- lpdumpd is a daemon on the device that actually reads
  dynamic partition metadata. Only lpdump can talk to it.

Bug: 126233777
Test: boots (sanity)
Test: lpdump

Change-Id: I0e21f35ac136bcbb0603940364e8117f2d6ac438
2019-03-25 10:14:20 -07:00

60 lines
1.9 KiB
Text

# Domain for atrace process.
# It is spawned either by traced_probes or by init for the boottrace service.
type atrace, domain, coredomain;
type atrace_exec, exec_type, file_type, system_file_type;
# boottrace services uses /data/misc/boottrace/categories
allow atrace boottrace_data_file:dir search;
allow atrace boottrace_data_file:file r_file_perms;
# Allow atrace to access tracefs.
allow atrace debugfs_tracing:dir r_dir_perms;
allow atrace debugfs_tracing:file rw_file_perms;
allow atrace debugfs_trace_marker:file getattr;
# Allow atrace to write data when a pipe is used for stdout/stderr
# This is used by Perfetto to capture the output on error in atrace.
allow atrace traced_probes:fd use;
allow atrace traced_probes:fifo_file write;
# atrace sets debug.atrace.* properties
set_prop(atrace, debug_prop)
# atrace pokes all the binder-enabled processes at startup with a
# SYSPROPS_TRANSACTION, to tell them to reload the debug.atrace.* properties.
binder_use(atrace)
allow atrace healthd:binder call;
allow atrace surfaceflinger:binder call;
allow atrace system_server:binder call;
get_prop(atrace, hwservicemanager_prop)
# atrace can call atrace HAL
hal_client_domain(atrace, hal_atrace)
allow atrace {
service_manager_type
-apex_service
-incident_service
-iorapd_service
-netd_service
-dnsresolver_service
-stats_service
-dumpstate_service
-installd_service
-vold_service
-lpdump_service
}:service_manager { find };
allow atrace servicemanager:service_manager list;
userdebug_or_eng(`
# atrace is generally invoked as a standalone binary from shell or perf
# daemons like Perfetto traced_probes. However, in userdebug builds, there is
# a further option to run atrace as an init daemon for boot tracing.
init_daemon_domain(atrace)
allow atrace debugfs_tracing_debug:dir r_dir_perms;
allow atrace debugfs_tracing_debug:file rw_file_perms;
')