Yuyang Huang | cfdea5f | 2023-01-18 16:52:43 +0900 | [diff] [blame] | 1 | ### |
| 2 | ### Untrusted apps. |
| 3 | ### |
| 4 | ### This file defines the rules for untrusted apps running with |
| 5 | ### 31 < targetSdkVersion <= 33. |
| 6 | ### |
| 7 | ### See public/untrusted_app.te for more information about which apps are |
| 8 | ### placed in this selinux domain. |
| 9 | ### |
| 10 | |
| 11 | typeattribute untrusted_app_32 coredomain; |
| 12 | |
| 13 | app_domain(untrusted_app_32) |
| 14 | untrusted_app_domain(untrusted_app_32) |
| 15 | net_domain(untrusted_app_32) |
| 16 | bluetooth_domain(untrusted_app_32) |
| 17 | |
| 18 | # Allow webview to access fd shared by sdksandbox for experiments data |
| 19 | # TODO(b/229249719): Will not be supported in Android U |
| 20 | allow untrusted_app_32 sdk_sandbox_data_file:fd use; |
| 21 | allow untrusted_app_32 sdk_sandbox_data_file:file write; |
| 22 | |
| 23 | neverallow untrusted_app_32 sdk_sandbox_data_file:file { open create }; |
| 24 | |
| 25 | # Connect to mdnsd via mdnsd socket. |
| 26 | unix_socket_connect(untrusted_app_32, mdnsd, mdnsd) |
| 27 | userdebug_or_eng(` |
| 28 | auditallow untrusted_app_32 mdnsd_socket:sock_file write; |
| 29 | auditallow untrusted_app_32 mdnsd:unix_stream_socket connectto; |
| 30 | ') |
Jeff Vander Stoep | f9a774f | 2023-03-27 12:30:23 +0200 | [diff] [blame^] | 31 | |
| 32 | # Allow calling inotify on APKs for backwards compatibility. This is disallowed |
| 33 | # for targetSdkVersion>=34 to remove a sidechannel. |
| 34 | allow untrusted_app_32 apk_data_file:dir { watch watch_reads }; |
| 35 | allow untrusted_app_32 apk_data_file:file { watch watch_reads }; |
| 36 | userdebug_or_eng(` |
| 37 | auditallow untrusted_app_32 apk_data_file:dir { watch watch_reads }; |
| 38 | auditallow untrusted_app_32 apk_data_file:file { watch watch_reads }; |
| 39 | ') |