untrusted_app_25.te 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ###
  2. ### Untrusted_app_25
  3. ###
  4. ### This file defines the rules for untrusted apps running with
  5. ### targetSdkVersion <= 25.
  6. ###
  7. ### Apps are labeled based on mac_permissions.xml (maps signer and
  8. ### optionally package name to seinfo value) and seapp_contexts (maps UID
  9. ### and optionally seinfo value to domain for process and type for data
  10. ### directory). The untrusted_app domain is the default assignment in
  11. ### seapp_contexts for any app with UID between APP_AID (10000)
  12. ### and AID_ISOLATED_START (99000) if the app has no specific seinfo
  13. ### value as determined from mac_permissions.xml. In current AOSP, this
  14. ### domain is assigned to all non-system apps as well as to any system apps
  15. ### that are not signed by the platform key. To move
  16. ### a system app into a specific domain, add a signer entry for it to
  17. ### mac_permissions.xml and assign it one of the pre-existing seinfo values
  18. ### or define and use a new seinfo value in both mac_permissions.xml and
  19. ### seapp_contexts.
  20. ###
  21. typeattribute untrusted_app_25 coredomain;
  22. app_domain(untrusted_app_25)
  23. untrusted_app_domain(untrusted_app_25)
  24. net_domain(untrusted_app_25)
  25. bluetooth_domain(untrusted_app_25)
  26. # b/34115651, b/33308258 - net.dns* properties read
  27. # This will go away in a future Android release
  28. get_prop(untrusted_app_25, net_dns_prop)
  29. auditallow untrusted_app_25 net_dns_prop:file read;
  30. # b/35917228 - /proc/misc access
  31. # This will go away in a future Android release
  32. allow untrusted_app_25 proc_misc:file r_file_perms;
  33. # Access to /proc/tty/drivers, to allow apps to determine if they
  34. # are running in an emulated environment.
  35. # b/33214085 b/33814662 b/33791054 b/33211769
  36. # https://github.com/strazzere/anti-emulator/blob/master/AntiEmulator/src/diff/strazzere/anti/emulator/FindEmulator.java
  37. # This will go away in a future Android release
  38. allow untrusted_app_25 proc_tty_drivers:file r_file_perms;
  39. # Text relocation support for API < 23. This is now disallowed for targetSdkVersion>=Q.
  40. # https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23
  41. allow untrusted_app_25 { apk_data_file app_data_file asec_public_file }:file execmod;
  42. # The ability to call exec() on files in the apps home directories
  43. # for targetApi<=25. This is also allowed for targetAPIs 26, 27,
  44. # and 28 in untrusted_app_27.te.
  45. allow untrusted_app_25 app_data_file:file execute_no_trans;
  46. auditallow untrusted_app_25 app_data_file:file { execute execute_no_trans };
  47. # The ability to invoke dex2oat. Historically required by ART, now only
  48. # allowed for targetApi<=28 for compat reasons.
  49. allow untrusted_app_25 dex2oat_exec:file rx_file_perms;
  50. userdebug_or_eng(`auditallow untrusted_app_25 dex2oat_exec:file rx_file_perms;')
  51. # The ability to talk to /dev/ashmem directly. targetApi>=29 must use
  52. # ASharedMemory instead.
  53. allow untrusted_app_25 ashmem_device:chr_file rw_file_perms;
  54. auditallow untrusted_app_25 ashmem_device:chr_file open;