iorapd.te 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # volume manager
  2. type iorapd, domain;
  3. type iorapd_exec, exec_type, file_type, system_file_type;
  4. type iorapd_tmpfs, file_type;
  5. r_dir_file(iorapd, rootfs)
  6. # Allow read/write /proc/sys/vm/drop/caches
  7. allow iorapd proc_drop_caches:file rw_file_perms;
  8. # Give iorapd a place where only iorapd can store files; everyone else is off limits
  9. allow iorapd iorapd_data_file:dir create_dir_perms;
  10. allow iorapd iorapd_data_file:file create_file_perms;
  11. # Allow iorapd to publish a binder service and make binder calls.
  12. binder_use(iorapd)
  13. add_service(iorapd, iorapd_service)
  14. # Allow iorapd to call into the system server so it can check permissions.
  15. binder_call(iorapd, system_server)
  16. allow iorapd permission_service:service_manager find;
  17. # IUserManager
  18. allow iorapd user_service:service_manager find;
  19. # IPackageManagerNative
  20. allow iorapd package_native_service:service_manager find;
  21. # talk to batteryservice
  22. binder_call(iorapd, healthd)
  23. # TODO: does each of the service_manager allow finds above need the binder_call?
  24. # iorapd temporarily changes its priority when running benchmarks
  25. allow iorapd self:global_capability_class_set sys_nice;
  26. # Allow to access Perfetto traced's privileged consumer socket to start/stop
  27. # tracing sessions and read trace data.
  28. unix_socket_connect(iorapd, traced_consumer, traced)
  29. ###
  30. ### neverallow rules
  31. ###
  32. neverallow {
  33. domain
  34. -iorapd
  35. } iorapd_data_file:dir ~{ open create read getattr setattr search relabelto ioctl };
  36. neverallow {
  37. domain
  38. -init
  39. -iorapd
  40. } iorapd_data_file:dir *;
  41. neverallow {
  42. domain
  43. -kernel
  44. -iorapd
  45. } iorapd_data_file:notdevfile_class_set ~{ relabelto getattr };
  46. neverallow {
  47. domain
  48. -init
  49. -kernel
  50. -vendor_init
  51. -iorapd
  52. } { iorapd_data_file }:notdevfile_class_set *;
  53. # Only system_server can interact with iorapd over binder
  54. neverallow { domain -system_server -iorapd } iorapd_service:service_manager find;
  55. neverallow iorapd {
  56. domain
  57. -healthd
  58. -servicemanager
  59. -system_server
  60. userdebug_or_eng(`-su')
  61. }:binder call;
  62. neverallow { domain -init } iorapd:process { transition dyntransition };
  63. neverallow iorapd domain:{ tcp_socket udp_socket rawip_socket } *;