blob: 6a38c5852562def1e3af3b14c6b07e3a9a56c958 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute lmkd coredomain;
Steven Moreland65981752022-02-10 00:32:44 +00002typeattribute lmkd bpfdomain;
Alex Klyubinf5446eb2017-03-23 14:27:32 -07003
dcashmancc39f632016-07-22 13:13:11 -07004init_daemon_domain(lmkd)
Inseob Kim55e5c9b2020-03-04 17:20:35 +09005
6# Set sys.lmk.* properties.
7set_prop(lmkd, system_lmk_prop)
Suren Baghdasaryanb221e662020-05-05 12:41:02 -07008
9# Set lmkd.* properties.
10set_prop(lmkd, lmkd_prop)
11
Suren Baghdasaryan592e06c2021-08-04 12:31:43 -070012# Get persist.device_config.lmk_native.* properties.
13get_prop(lmkd, device_config_lmkd_native_prop)
14
Carlos Galoea1bd5d2024-03-12 20:04:41 +000015# Needed for reading tracepoint ids in order to attach bpf programs.
16allow lmkd debugfs_tracing:file r_file_perms;
17allow lmkd self:perf_event { cpu kernel open write };
18
Suren Baghdasaryanea2941b2021-05-27 18:22:41 -070019allow lmkd fs_bpf:file read;
Carlos Galoea1bd5d2024-03-12 20:04:41 +000020allow lmkd bpfloader:bpf { map_read map_write prog_run };
21
22# Needed for polling directly from the bpf ring buffer's fd
23allow lmkd fs_bpf_lmkd_memevents_rb:file { read write };
24allow lmkd fs_bpf_lmkd_memevents_prog:file read;
Suren Baghdasaryanea2941b2021-05-27 18:22:41 -070025
Inseob Kim85acf6e2021-03-10 10:42:23 +090026neverallow { domain -init -lmkd -vendor_init } lmkd_prop:property_service set;
Carlos Galoea1bd5d2024-03-12 20:04:41 +000027neverallow lmkd self:perf_event ~{ cpu kernel open write };