storaged.te 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # storaged daemon
  2. type storaged, domain, coredomain, mlstrustedsubject;
  3. type storaged_exec, system_file_type, exec_type, file_type;
  4. init_daemon_domain(storaged)
  5. # Read access to pseudo filesystems
  6. r_dir_file(storaged, domain)
  7. # Read /proc/uid_io/stats
  8. allow storaged proc_uid_io_stats:file r_file_perms;
  9. # Read /data/system/packages.list
  10. allow storaged system_data_file:file r_file_perms;
  11. allow storaged packages_list_file:file r_file_perms;
  12. # Store storaged proto file
  13. allow storaged storaged_data_file:dir rw_dir_perms;
  14. allow storaged storaged_data_file:file create_file_perms;
  15. userdebug_or_eng(`
  16. # Read access to debugfs
  17. allow storaged debugfs_mmc:dir search;
  18. allow storaged debugfs_mmc:file r_file_perms;
  19. ')
  20. # Needed to provide debug dump output via dumpsys pipes.
  21. allow storaged shell:fd use;
  22. allow storaged shell:fifo_file write;
  23. # Needed for GMScore to call dumpsys storaged
  24. allow storaged priv_app:fd use;
  25. allow storaged { privapp_data_file app_data_file }:file write;
  26. allow storaged permission_service:service_manager find;
  27. # Binder permissions
  28. add_service(storaged, storaged_service)
  29. binder_use(storaged)
  30. binder_call(storaged, system_server)
  31. hal_client_domain(storaged, hal_health)
  32. # Implements a dumpsys interface.
  33. allow storaged dumpstate:fd use;
  34. # use a subset of the package manager service
  35. allow storaged package_native_service:service_manager find;
  36. # Kernel does extra check on CAP_DAC_OVERRIDE for libbinder when storaged is
  37. # running as root. See b/35323867 #3.
  38. dontaudit storaged self:global_capability_class_set { dac_override dac_read_search };
  39. # For collecting bugreports.
  40. allow storaged dumpstate:fifo_file write;
  41. ###
  42. ### neverallow
  43. ###
  44. neverallow storaged domain:process ptrace;
  45. neverallow storaged self:capability_class_set *;