2017-02-13 22:33:27 +01:00
|
|
|
###
|
|
|
|
### Untrusted_app_25
|
|
|
|
###
|
|
|
|
### This file defines the rules for untrusted apps running with
|
|
|
|
### targetSdkVersion <= 25.
|
|
|
|
###
|
|
|
|
### Apps are labeled based on mac_permissions.xml (maps signer and
|
|
|
|
### optionally package name to seinfo value) and seapp_contexts (maps UID
|
|
|
|
### and optionally seinfo value to domain for process and type for data
|
|
|
|
### directory). The untrusted_app domain is the default assignment in
|
|
|
|
### seapp_contexts for any app with UID between APP_AID (10000)
|
|
|
|
### and AID_ISOLATED_START (99000) if the app has no specific seinfo
|
|
|
|
### value as determined from mac_permissions.xml. In current AOSP, this
|
|
|
|
### domain is assigned to all non-system apps as well as to any system apps
|
|
|
|
### that are not signed by the platform key. To move
|
|
|
|
### a system app into a specific domain, add a signer entry for it to
|
|
|
|
### mac_permissions.xml and assign it one of the pre-existing seinfo values
|
|
|
|
### or define and use a new seinfo value in both mac_permissions.xml and
|
|
|
|
### seapp_contexts.
|
|
|
|
###
|
|
|
|
|
2017-03-23 22:27:32 +01:00
|
|
|
typeattribute untrusted_app_25 coredomain;
|
|
|
|
|
2017-02-13 22:33:27 +01:00
|
|
|
app_domain(untrusted_app_25)
|
|
|
|
untrusted_app_domain(untrusted_app_25)
|
|
|
|
net_domain(untrusted_app_25)
|
|
|
|
bluetooth_domain(untrusted_app_25)
|
|
|
|
|
|
|
|
# b/34115651 - net.dns* properties read
|
|
|
|
# This will go away in a future Android release
|
|
|
|
get_prop(untrusted_app_25, net_dns_prop)
|
2017-03-03 21:17:49 +01:00
|
|
|
|
|
|
|
# b/35917228 - /proc/misc access
|
|
|
|
# This will go away in a future Android release
|
|
|
|
allow untrusted_app_25 proc_misc:file r_file_perms;
|
2017-03-05 05:09:10 +01:00
|
|
|
|
|
|
|
# Access to /proc/tty/drivers, to allow apps to determine if they
|
|
|
|
# are running in an emulated environment.
|
|
|
|
# b/33214085 b/33814662 b/33791054 b/33211769
|
|
|
|
# https://github.com/strazzere/anti-emulator/blob/master/AntiEmulator/src/diff/strazzere/anti/emulator/FindEmulator.java
|
|
|
|
# This will go away in a future Android release
|
|
|
|
allow untrusted_app_25 proc_tty_drivers:file r_file_perms;
|
Start the process of locking down proc/net
Files in /proc/net leak information. This change is the first step in
determining which files apps may use, whitelisting benign access, and
otherwise removing access while providing safe alternative APIs.
To that end, this change:
* Introduces the proc_net_type attribute which will assigned to any
new SELinux types in /proc/net to avoid removing access to privileged
processes. These processes may be evaluated later, but are lower
priority than apps.
* Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing
use by VPN apps. This may be replaced by an alternative API.
* Audits all other proc/net access for apps.
* Audits proc/net access for other processes which are currently
granted broad read access to /proc/net but should not be including
storaged, zygote, clatd, logd, preopt2cachename and vold.
Bug: 9496886
Bug: 68016944
Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube
navigate maps, send text message, make voice call, make video call.
Verify no avc "granted" messages in the logs.
Test: A few VPN apps including "VPN Monster", "Turbo VPN", and
"Freighter". Verify no logspam with the current setup.
Test: atest CtsNativeNetTestCases
Test: atest netd_integration_test
Test: atest QtaguidPermissionTest
Test: atest FileSystemPermissionTest
Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457
Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457
(cherry picked from commit 087318957f26e921d62f2e234fc14bff3c59030e)
2018-04-10 21:47:48 +02:00
|
|
|
|
|
|
|
# qtaguid access. This is not a public API. Access will be removed in a
|
|
|
|
# future version of Android.
|
|
|
|
allow untrusted_app_25 proc_qtaguid_ctrl:file rw_file_perms;
|
|
|
|
r_dir_file(untrusted_app_25, proc_qtaguid_stat)
|
|
|
|
allow untrusted_app_25 qtaguid_device:chr_file r_file_perms;
|
2018-08-08 00:14:34 +02:00
|
|
|
|
|
|
|
# Text relocation support for API < 23
|
|
|
|
# https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23
|
|
|
|
allow untrusted_app_25 { apk_data_file app_data_file asec_public_file }:file execmod;
|