2018-02-20 20:02:39 +01:00
|
|
|
# llkd Live LocK Daemon
|
|
|
|
typeattribute llkd coredomain;
|
|
|
|
|
|
|
|
init_daemon_domain(llkd)
|
|
|
|
|
2018-08-08 01:03:47 +02:00
|
|
|
get_prop(llkd, llkd_prop)
|
|
|
|
|
2018-02-20 20:02:39 +01:00
|
|
|
allow llkd self:global_capability_class_set kill;
|
2018-08-08 01:03:47 +02:00
|
|
|
userdebug_or_eng(`
|
2020-01-10 23:23:38 +01:00
|
|
|
allow llkd self:global_capability_class_set { sys_ptrace sys_admin };
|
2018-09-07 00:19:40 +02:00
|
|
|
allow llkd self:global_capability_class_set { dac_override dac_read_search };
|
2018-08-08 01:03:47 +02:00
|
|
|
')
|
2018-02-20 20:02:39 +01:00
|
|
|
|
|
|
|
# llkd optionally locks itself in memory, to prevent it from being
|
|
|
|
# swapped out and unable to discover a kernel in live-lock state.
|
|
|
|
allow llkd self:global_capability_class_set ipc_lock;
|
|
|
|
|
|
|
|
# Send kill signals to _anyone_ suffering from Live Lock
|
|
|
|
allow llkd domain:process sigkill;
|
|
|
|
|
2018-08-08 01:03:47 +02:00
|
|
|
# read stack to check for Live Lock
|
|
|
|
userdebug_or_eng(`
|
|
|
|
allow llkd {
|
|
|
|
domain
|
2018-08-17 09:35:42 +02:00
|
|
|
-apexd
|
2018-09-13 20:07:14 +02:00
|
|
|
-kernel
|
2018-08-08 01:03:47 +02:00
|
|
|
-keystore
|
|
|
|
-init
|
|
|
|
-llkd
|
2018-09-13 20:07:14 +02:00
|
|
|
-ueventd
|
|
|
|
-vendor_init
|
2018-08-08 01:03:47 +02:00
|
|
|
}:process ptrace;
|
|
|
|
')
|
|
|
|
|
2018-02-20 20:02:39 +01:00
|
|
|
# live lock watchdog process allowed to look through /proc/
|
|
|
|
allow llkd domain:dir r_dir_perms;
|
|
|
|
allow llkd domain:file r_file_perms;
|
|
|
|
allow llkd domain:lnk_file read;
|
|
|
|
# Set /proc/sys/kernel/hung_task_*
|
|
|
|
allow llkd proc_hung_task:file rw_file_perms;
|
|
|
|
|
|
|
|
# live lock watchdog process allowed to dump process trace and
|
|
|
|
# reboot because orderly shutdown may not be possible.
|
2021-07-02 15:54:12 +02:00
|
|
|
allow llkd proc_sysrq:file rw_file_perms;
|
2018-02-20 20:02:39 +01:00
|
|
|
allow llkd kmsg_device:chr_file w_file_perms;
|
|
|
|
|
|
|
|
### neverallow rules
|
|
|
|
|
|
|
|
neverallow { domain -init } llkd:process { dyntransition transition };
|
2018-08-08 01:03:47 +02:00
|
|
|
neverallow { domain userdebug_or_eng(`-crash_dump') } llkd:process ptrace;
|
2018-02-20 20:02:39 +01:00
|
|
|
|
|
|
|
# never honor LD_PRELOAD
|
|
|
|
neverallow * llkd:process noatsecure;
|