Skip to content
Snippets Groups Projects
Commit 3fa4ac55 authored by Hector Dearman's avatar Hector Dearman
Browse files

Allow adb root to send config to perfetto

The perfetto binary (the frontend to traced) reads an input config
from stdin. This CL adds allows perfetto to read the config
from adb shell when the user is rooted

Sample denials:
avc: denied { read } for comm="perfetto" path="pipe:[92340]"
dev="pipefs" ino=92340 scontext=u:r:perfetto:s0 tcontext=u:r:su:s0
tclass=fifo_file permissive=0
avc: denied { read } for comm="perfetto" path="pipe:[92491]"
dev="pipefs" ino=92491 scontext=u:r:perfetto:s0 tcontext=u:r:su:s0
tclass=fifo_file permissive=0

Test: adb root
adb shell
echo 'duration_ms: 1000;' > /sdcard/config
cat /sdcard/config | perfetto --txt -c - -d

Change-Id: I12042dfa9a2c262cec907f0231ce2184f46d1be8
parent e00ca14c
No related branches found
No related tags found
No related merge requests found
...@@ -20,12 +20,11 @@ binder_use(perfetto) ...@@ -20,12 +20,11 @@ binder_use(perfetto)
binder_call(perfetto, system_server) binder_call(perfetto, system_server)
allow perfetto dropbox_service:service_manager find; allow perfetto dropbox_service:service_manager find;
# Allow statsd and shell to pipe the trace config to perfetto on stdin and to # Allow perfetto to read the trace config from statsd and shell
# print out on stdout/stderr. # (both root and non-root) on stdin and also to write the resulting trace to
allow perfetto statsd:fd use; # stdout.
allow perfetto statsd:fifo_file { getattr read write }; allow perfetto { statsd shell su }:fd use;
allow perfetto shell:fd use; allow perfetto { statsd shell su }:fifo_file { getattr read write };
allow perfetto shell:fifo_file { getattr read write };
# Allow to communicate use, read and write over the adb connection. # Allow to communicate use, read and write over the adb connection.
allow perfetto adbd:fd use; allow perfetto adbd:fd use;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment