rs.te 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Any files which would have been created as app_data_file
  2. # will be created as app_exec_data_file instead.
  3. allow rs app_data_file:dir ra_dir_perms;
  4. allow rs app_exec_data_file:file create_file_perms;
  5. type_transition rs app_data_file:file app_exec_data_file;
  6. # Follow /data/user/0 symlink
  7. allow rs system_data_file:lnk_file read;
  8. # Read files from the app home directory.
  9. allow rs app_data_file:file r_file_perms;
  10. allow rs app_data_file:dir r_dir_perms;
  11. # Cleanup app_exec_data_file files in the app home directory.
  12. allow rs app_data_file:dir remove_name;
  13. # Use vendor resources
  14. allow rs vendor_file:dir r_dir_perms;
  15. r_dir_file(rs, vendor_overlay_file)
  16. r_dir_file(rs, vendor_app_file)
  17. # Read contents of app apks
  18. r_dir_file(rs, apk_data_file)
  19. allow rs gpu_device:chr_file rw_file_perms;
  20. allow rs ion_device:chr_file r_file_perms;
  21. allow rs same_process_hal_file:file { r_file_perms execute };
  22. # File descriptors passed from app to renderscript
  23. allow rs { untrusted_app_all ephemeral_app }:fd use;
  24. # rs can access app data, so ensure it can only be entered via an app domain and cannot have
  25. # CAP_DAC_OVERRIDE.
  26. neverallow rs rs:capability_class_set *;
  27. neverallow { domain -appdomain } rs:process { dyntransition transition };
  28. neverallow rs { domain -crash_dump }:process { dyntransition transition };
  29. neverallow rs app_data_file:file_class_set ~r_file_perms;
  30. # rs should never use network sockets
  31. neverallow rs *:network_socket_class_set *;