sdcardd.te 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. type sdcardd, domain;
  2. type sdcardd_exec, system_file_type, exec_type, file_type;
  3. allow sdcardd cgroup:dir create_dir_perms;
  4. allow sdcardd fuse_device:chr_file rw_file_perms;
  5. allow sdcardd rootfs:dir mounton; # TODO: deprecated in M
  6. allow sdcardd sdcardfs:filesystem remount;
  7. allow sdcardd tmpfs:dir r_dir_perms;
  8. allow sdcardd mnt_media_rw_file:dir r_dir_perms;
  9. allow sdcardd storage_file:dir search;
  10. allow sdcardd storage_stub_file:dir { search mounton };
  11. allow sdcardd sdcard_type:filesystem { mount unmount };
  12. allow sdcardd self:global_capability_class_set { setuid setgid dac_override dac_read_search sys_admin sys_resource };
  13. allow sdcardd sdcard_type:dir create_dir_perms;
  14. allow sdcardd sdcard_type:file create_file_perms;
  15. allow sdcardd media_rw_data_file:dir create_dir_perms;
  16. allow sdcardd media_rw_data_file:file create_file_perms;
  17. # Read /data/system/packages.list.
  18. allow sdcardd system_data_file:file r_file_perms;
  19. allow sdcardd packages_list_file:file r_file_perms;
  20. # Read /data/.layout_version
  21. allow sdcardd install_data_file:file r_file_perms;
  22. # Allow stdin/out back to vold
  23. allow sdcardd vold:fd use;
  24. allow sdcardd vold:fifo_file { read write getattr };
  25. # Allow running on top of expanded storage
  26. allow sdcardd mnt_expand_file:dir search;
  27. # access /proc/filesystems
  28. allow sdcardd proc_filesystems:file r_file_perms;
  29. ###
  30. ### neverallow rules
  31. ###
  32. # The sdcard daemon should no longer be started from init
  33. neverallow init sdcardd_exec:file execute;
  34. neverallow init sdcardd:process { transition dyntransition };