blob: 5bad58fe05322e82878185e2267ecf81806dddd5 [file] [log] [blame]
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -08001###
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
Alex Klyubinf5446eb2017-03-23 14:27:32 -070022typeattribute untrusted_app_25 coredomain;
23
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080024app_domain(untrusted_app_25)
25untrusted_app_domain(untrusted_app_25)
26net_domain(untrusted_app_25)
27bluetooth_domain(untrusted_app_25)
28
Jeff Vander Stoepd5bf5c02019-03-29 20:58:28 -070029# b/34115651 - net.dns* properties read
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080030# This will go away in a future Android release
31get_prop(untrusted_app_25, net_dns_prop)
Nick Kralevich50bb7b52017-03-03 12:17:49 -080032
33# b/35917228 - /proc/misc access
34# This will go away in a future Android release
35allow untrusted_app_25 proc_misc:file r_file_perms;
Nick Kralevichb4f354f2017-03-04 20:09:10 -080036
37# Access to /proc/tty/drivers, to allow apps to determine if they
38# are running in an emulated environment.
39# b/33214085 b/33814662 b/33791054 b/33211769
40# https://github.com/strazzere/anti-emulator/blob/master/AntiEmulator/src/diff/strazzere/anti/emulator/FindEmulator.java
41# This will go away in a future Android release
42allow untrusted_app_25 proc_tty_drivers:file r_file_perms;
Jeff Vander Stoep7a4af302018-04-10 12:47:48 -070043
Jeff Vander Stoepc9aba122019-04-02 13:01:10 -070044# Text relocation support for API < 23. This is now disallowed for targetSdkVersion>=Q.
Nick Kralevichf3eb9852018-08-07 15:14:34 -070045# https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23
46allow untrusted_app_25 { apk_data_file app_data_file asec_public_file }:file execmod;
Yabin Cui5dc2c8c2018-11-02 11:12:43 -070047
Nick Kralevich65a89c12018-12-21 10:03:50 -080048# The ability to call exec() on files in the apps home directories
49# for targetApi<=25. This is also allowed for targetAPIs 26, 27,
50# and 28 in untrusted_app_27.te.
51allow untrusted_app_25 app_data_file:file execute_no_trans;
Alan Stokes3f63dbf2019-01-28 10:33:08 +000052auditallow untrusted_app_25 app_data_file:file { execute execute_no_trans };
David Brazdil535c5d22018-11-19 23:02:49 +000053
54# The ability to invoke dex2oat. Historically required by ART, now only
55# allowed for targetApi<=28 for compat reasons.
56allow untrusted_app_25 dex2oat_exec:file rx_file_perms;
Nick Kralevichcfe1bae2018-11-20 10:45:56 -080057userdebug_or_eng(`auditallow untrusted_app_25 dex2oat_exec:file rx_file_perms;')
Tri Vo73d0a672019-01-27 13:39:19 -080058
59# The ability to talk to /dev/ashmem directly. targetApi>=29 must use
60# ASharedMemory instead.
61allow untrusted_app_25 ashmem_device:chr_file rw_file_perms;
Tri Vo8b12ff52019-02-12 14:14:30 -080062auditallow untrusted_app_25 ashmem_device:chr_file open;