blob: f6dd9069ddf24507b19265bb07fc4760b5f9b8cb [file] [log] [blame]
Yu-Ting Tseng3e8e8ea2023-09-25 18:42:03 +00001type uprobestats, domain, coredomain;
2
3typeattribute uprobestats bpfdomain;
4
5type uprobestats_exec, system_file_type, exec_type, file_type;
6
Yu-Ting Tseng43cae4e2023-12-15 00:48:23 +00007# Allow init to start uprobestats.
8init_daemon_domain(uprobestats)
Yu-Ting Tseng3e8e8ea2023-09-25 18:42:03 +00009
Yu-Ting Tsengbaea6412024-01-16 14:02:59 -080010allow uprobestats fs_bpf_uprobestats:file { read write };
11allow uprobestats fs_bpf_uprobestats:dir search;
Yu-Ting Tseng3e8e8ea2023-09-25 18:42:03 +000012allow uprobestats bpfloader:bpf { map_read map_write prog_run };
13allow uprobestats self:capability2 perfmon;
14allow uprobestats self:perf_event { cpu open write };
15allow uprobestats sysfs_uprobe:file { open read };
16allow uprobestats sysfs_uprobe:dir { search };
Yu-Ting Tseng43cae4e2023-12-15 00:48:23 +000017
18# Allow uprobestats to popen oatdump.
Yu-Ting Tseng7dea3a32024-07-10 01:48:59 +000019allow uprobestats oatdump_exec:file rx_file_perms;
Yu-Ting Tseng43cae4e2023-12-15 00:48:23 +000020
21# Allow uprobestats to write atoms to statsd
22unix_socket_send(uprobestats, statsdw, statsd)
23
24# For registration with system server as a process observer.
25binder_use(uprobestats)
26allow uprobestats activity_service:service_manager find;
27binder_call(uprobestats, system_server);
28
29# Allow uprobestats to talk to native package manager
30allow uprobestats package_native_service:service_manager find;
31
32# Allow uprobestats to scan /proc/<pid>/cmdline.
33r_dir_file(uprobestats, { domain -appdomain })
34
35# Allow uprobestats to manage its own config files.
36allow uprobestats uprobestats_configs_data_file:dir rw_dir_perms;
37allow uprobestats uprobestats_configs_data_file:file { r_file_perms unlink };