llkd.te 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # llkd Live LocK Daemon
  2. typeattribute llkd coredomain;
  3. init_daemon_domain(llkd)
  4. get_prop(llkd, llkd_prop)
  5. allow llkd self:global_capability_class_set kill;
  6. userdebug_or_eng(`
  7. allow llkd self:global_capability_class_set sys_ptrace;
  8. allow llkd self:global_capability_class_set { dac_override dac_read_search };
  9. ')
  10. # llkd optionally locks itself in memory, to prevent it from being
  11. # swapped out and unable to discover a kernel in live-lock state.
  12. allow llkd self:global_capability_class_set ipc_lock;
  13. # Send kill signals to _anyone_ suffering from Live Lock
  14. allow llkd domain:process sigkill;
  15. # read stack to check for Live Lock
  16. userdebug_or_eng(`
  17. allow llkd {
  18. domain
  19. -apexd
  20. -kernel
  21. -keystore
  22. -init
  23. -llkd
  24. -ueventd
  25. -vendor_init
  26. }:process ptrace;
  27. ')
  28. # live lock watchdog process allowed to look through /proc/
  29. allow llkd domain:dir r_dir_perms;
  30. allow llkd domain:file r_file_perms;
  31. allow llkd domain:lnk_file read;
  32. # Set /proc/sys/kernel/hung_task_*
  33. allow llkd proc_hung_task:file rw_file_perms;
  34. # live lock watchdog process allowed to dump process trace and
  35. # reboot because orderly shutdown may not be possible.
  36. allow llkd proc_sysrq:file w_file_perms;
  37. allow llkd kmsg_device:chr_file w_file_perms;
  38. ### neverallow rules
  39. neverallow { domain -init } llkd:process { dyntransition transition };
  40. neverallow { domain userdebug_or_eng(`-crash_dump') } llkd:process ptrace;
  41. # never honor LD_PRELOAD
  42. neverallow * llkd:process noatsecure;