Jeff Vander Stoep | bacb6d7 | 2017-02-13 13:33:27 -0800 | [diff] [blame] | 1 | ### |
Jeff Vander Stoep | 3aa7ca5 | 2018-04-03 11:22:38 -0700 | [diff] [blame] | 2 | ### Untrusted_27. |
Jeff Vander Stoep | bacb6d7 | 2017-02-13 13:33:27 -0800 | [diff] [blame] | 3 | ### |
Jeff Vander Stoep | 3aa7ca5 | 2018-04-03 11:22:38 -0700 | [diff] [blame] | 4 | ### This file defines the rules for untrusted apps running with |
Yabin Cui | 5dc2c8c | 2018-11-02 11:12:43 -0700 | [diff] [blame] | 5 | ### 25 < targetSdkVersion <= 28. |
Jeff Vander Stoep | 3aa7ca5 | 2018-04-03 11:22:38 -0700 | [diff] [blame] | 6 | ### |
Jeff Vander Stoep | 1f7ae8e | 2020-01-20 10:14:48 +0100 | [diff] [blame] | 7 | ### See public/untrusted_app.te for more information about which apps are |
| 8 | ### placed in this selinux domain. |
Jeff Vander Stoep | bacb6d7 | 2017-02-13 13:33:27 -0800 | [diff] [blame] | 9 | ### |
| 10 | |
Jeff Vander Stoep | 3aa7ca5 | 2018-04-03 11:22:38 -0700 | [diff] [blame] | 11 | typeattribute untrusted_app_27 coredomain; |
Jeff Vander Stoep | bacb6d7 | 2017-02-13 13:33:27 -0800 | [diff] [blame] | 12 | |
Jeff Vander Stoep | 3aa7ca5 | 2018-04-03 11:22:38 -0700 | [diff] [blame] | 13 | app_domain(untrusted_app_27) |
| 14 | untrusted_app_domain(untrusted_app_27) |
| 15 | net_domain(untrusted_app_27) |
| 16 | bluetooth_domain(untrusted_app_27) |
Yabin Cui | 5dc2c8c | 2018-11-02 11:12:43 -0700 | [diff] [blame] | 17 | |
Jeff Vander Stoep | c9aba12 | 2019-04-02 13:01:10 -0700 | [diff] [blame] | 18 | # Text relocation support for API < 23. This is now disallowed for targetSdkVersion>=Q. |
| 19 | # https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23 |
| 20 | allow untrusted_app_27 { apk_data_file app_data_file asec_public_file }:file execmod; |
| 21 | |
Nick Kralevich | 65a89c1 | 2018-12-21 10:03:50 -0800 | [diff] [blame] | 22 | # The ability to call exec() on files in the apps home directories |
| 23 | # for targetApi 26, 27, and 28. |
| 24 | allow untrusted_app_27 app_data_file:file execute_no_trans; |
Alan Stokes | 3f63dbf | 2019-01-28 10:33:08 +0000 | [diff] [blame] | 25 | auditallow untrusted_app_27 app_data_file:file { execute execute_no_trans }; |
David Brazdil | 535c5d2 | 2018-11-19 23:02:49 +0000 | [diff] [blame] | 26 | |
| 27 | # The ability to invoke dex2oat. Historically required by ART, now only |
| 28 | # allowed for targetApi<=28 for compat reasons. |
| 29 | allow untrusted_app_27 dex2oat_exec:file rx_file_perms; |
Nick Kralevich | cfe1bae | 2018-11-20 10:45:56 -0800 | [diff] [blame] | 30 | userdebug_or_eng(`auditallow untrusted_app_27 dex2oat_exec:file rx_file_perms;') |
Tri Vo | 73d0a67 | 2019-01-27 13:39:19 -0800 | [diff] [blame] | 31 | |
| 32 | # The ability to talk to /dev/ashmem directly. targetApi>=29 must use |
| 33 | # ASharedMemory instead. |
| 34 | allow untrusted_app_27 ashmem_device:chr_file rw_file_perms; |
Tri Vo | 8b12ff5 | 2019-02-12 14:14:30 -0800 | [diff] [blame] | 35 | auditallow untrusted_app_27 ashmem_device:chr_file open; |
Tri Vo | 8eff3e2 | 2019-04-11 15:23:24 -0700 | [diff] [blame] | 36 | |
| 37 | # Read /mnt/sdcard symlink. |
| 38 | allow untrusted_app_27 mnt_sdcard_file:lnk_file r_file_perms; |
Bram Bonné | ea5460a | 2021-05-12 14:19:24 +0200 | [diff] [blame] | 39 | |
| 40 | # allow sending RTM_GETNEIGH{TBL} messages. |
| 41 | allow untrusted_app_27 self:netlink_route_socket nlmsg_getneigh; |
| 42 | auditallow untrusted_app_27 self:netlink_route_socket nlmsg_getneigh; |
Yuyang Huang | cfdea5f | 2023-01-18 16:52:43 +0900 | [diff] [blame] | 43 | |
| 44 | # Connect to mdnsd via mdnsd socket. |
| 45 | unix_socket_connect(untrusted_app_27, mdnsd, mdnsd) |
| 46 | userdebug_or_eng(` |
| 47 | auditallow untrusted_app_27 mdnsd_socket:sock_file write; |
| 48 | auditallow untrusted_app_27 mdnsd:unix_stream_socket connectto; |
| 49 | ') |
Jeff Vander Stoep | f9a774f | 2023-03-27 12:30:23 +0200 | [diff] [blame] | 50 | |
| 51 | # Allow calling inotify on APKs for backwards compatibility. This is disallowed |
| 52 | # for targetSdkVersion>=34 to remove a sidechannel. |
| 53 | allow untrusted_app_27 apk_data_file:dir { watch watch_reads }; |
| 54 | allow untrusted_app_27 apk_data_file:file { watch watch_reads }; |
| 55 | userdebug_or_eng(` |
| 56 | auditallow untrusted_app_27 apk_data_file:dir { watch watch_reads }; |
| 57 | auditallow untrusted_app_27 apk_data_file:file { watch watch_reads }; |
| 58 | ') |