diff --git a/private/perfetto.te b/private/perfetto.te index 4d8720a2d084d1c3cfe4a9a4a65eac2927810ba2..2e43d9015e89211b97221dc5d7932938f7689f2a 100644 --- a/private/perfetto.te +++ b/private/perfetto.te @@ -3,7 +3,6 @@ # This command line client accesses the privileged socket of the traced # daemon. -type perfetto, domain, coredomain; type perfetto_exec, system_file_type, exec_type, file_type; tmpfs_domain(perfetto); diff --git a/private/shell.te b/private/shell.te index 8867112af5aa729764ad9f00b111a3f02a49e504..95e0d4028bea6ffcad759357a106cd814a79dc3c 100644 --- a/private/shell.te +++ b/private/shell.te @@ -44,6 +44,8 @@ domain_auto_trans(shell, vendor_shell_exec, vendor_shell) # transition into its own domain, so that it behaves consistently to # when exec()-d by statsd. domain_auto_trans(shell, perfetto_exec, perfetto) +# Allow to send SIGINT to perfetto when daemonized. +allow shell perfetto:process signal; # Allow shell to run adb shell cmd stats commands. Needed for CTS. binder_call(shell, statsd); diff --git a/public/app.te b/public/app.te index aa735b4703d72a4dfedf8bca0901d033e82e9611..94acac7548ccd41a7f0f7aa64f9701d8c9a35426 100644 --- a/public/app.te +++ b/public/app.te @@ -432,7 +432,9 @@ neverallow { appdomain -shell } { domain -appdomain }:file no_rw_file_perms; # sigchld allowed for parent death notification. # signull allowed for kill(pid, 0) existence test. # All others prohibited. -neverallow appdomain { domain -appdomain }:process +# -perfetto is to allow shell (which is an appdomain) to kill perfetto +# (see private/shell.te). +neverallow appdomain { domain -appdomain -perfetto }:process { sigkill sigstop signal }; # Write to rootfs. diff --git a/public/perfetto.te b/public/perfetto.te new file mode 100644 index 0000000000000000000000000000000000000000..cec0e6f09278d2e85d05b5c76715cbdb414ae8d6 --- /dev/null +++ b/public/perfetto.te @@ -0,0 +1 @@ +type perfetto, domain, coredomain;