2d6fb3971b
This change adds a neverallow rule in traced.te to limit the processes that can find tracingproxy_service, the context for TracingServiceProxy. I wanted to avoid moving the tracingproxy_service definition to public, so there were a few services that are exempted from this neverallow rule. Bug: 191391382 Test: Manually verified that with this change, along with the other change in this topic, I see no errors when taking a bugreport while a Traceur trace is running and the expected trace is included in the generated bugreport. Change-Id: I28d0b1b08baac43a53fe5a1ff0f67b788d51dc74 Merged-In: I8658df0db92ae9cf4fefe2eebb4d6d9a5349ea89
80 lines
2.6 KiB
Text
80 lines
2.6 KiB
Text
# Domain for atrace process.
|
|
# It is spawned either by traced_probes or by init for the boottrace service.
|
|
|
|
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.
|
|
|
|
# Allow discovery of binder services.
|
|
allow atrace {
|
|
service_manager_type
|
|
-apex_service
|
|
-dnsresolver_service
|
|
-dumpstate_service
|
|
-incident_service
|
|
-installd_service
|
|
-iorapd_service
|
|
-lpdump_service
|
|
-netd_service
|
|
-stats_service
|
|
-tracingproxy_service
|
|
-vold_service
|
|
-default_android_service
|
|
}:service_manager { find };
|
|
allow atrace servicemanager:service_manager list;
|
|
|
|
# Allow notifying the processes hosting specific binder services that
|
|
# trace-related system properties have changed.
|
|
binder_use(atrace)
|
|
allow atrace healthd:binder call;
|
|
allow atrace surfaceflinger:binder call;
|
|
allow atrace system_server:binder call;
|
|
allow atrace cameraserver:binder call;
|
|
|
|
# Similarly, on debug builds, allow specific HALs to be notified that
|
|
# trace-related system properties have changed.
|
|
userdebug_or_eng(`
|
|
# List HAL interfaces.
|
|
allow atrace hwservicemanager:hwservice_manager list;
|
|
# Notify the camera HAL.
|
|
hal_client_domain(atrace, hal_camera)
|
|
hal_client_domain(atrace, hal_vibrator)
|
|
')
|
|
|
|
# Remove logspam from notification attempts to non-allowlisted services.
|
|
dontaudit atrace hwservice_manager_type:hwservice_manager find;
|
|
dontaudit atrace service_manager_type:service_manager find;
|
|
dontaudit atrace domain:binder call;
|
|
|
|
# atrace can call atrace HAL
|
|
hal_client_domain(atrace, hal_atrace)
|
|
|
|
get_prop(atrace, hwservicemanager_prop)
|
|
|
|
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;
|
|
')
|