blob: 7d29134c6bf0ea95c16bf57dbaea4a1ea18aa571 [file] [log] [blame]
William Hester5f486c72019-01-15 13:39:30 -08001# Allow apps to read the Test Harness Mode property. This property is used in
2# the implementation of ActivityManager.isDeviceInTestHarnessMode()
3get_prop(appdomain, test_harness_prop)
4
Inseob Kimdbcc4592020-05-21 20:12:55 +09005get_prop(appdomain, boot_status_prop)
6get_prop(appdomain, dalvik_config_prop)
Inseob Kim5eacf722020-07-01 01:27:49 +09007get_prop(appdomain, packagemanager_config_prop)
Inseob Kimdbcc4592020-05-21 20:12:55 +09008get_prop(appdomain, surfaceflinger_color_prop)
9get_prop(appdomain, systemsound_config_prop)
Inseob Kim641cffe2020-06-05 10:40:16 +090010get_prop(appdomain, telephony_config_prop)
Inseob Kimdbcc4592020-05-21 20:12:55 +090011get_prop(appdomain, userspace_reboot_config_prop)
12get_prop(appdomain, vold_config_prop)
13
Florian Mayer5e522812019-10-08 16:15:14 +010014userdebug_or_eng(`perfetto_producer({ appdomain })')
15
Jeff Vander Stoep607bc672019-12-16 10:59:03 +010016# Prevent apps from causing presubmit failures.
17# Apps can cause selinux denials by accessing CE storage
18# and/or external storage. In either case, the selinux denial is
19# not the cause of the failure, but just a symptom that
20# storage isn't ready. Many apps handle the failure appropriately.
21#
22# Apps cannot access external storage before it becomes available.
23dontaudit appdomain storage_stub_file:dir getattr;
24# Attempts to write to system_data_file is generally a sign
25# that apps are attempting to access encrypted storage before
26# the ACTION_USER_UNLOCKED intent is delivered. Apps are not
27# allowed to write to CE storage before it's available.
28# Attempting to do so will be blocked by both selinux and unix
29# permissions.
30dontaudit appdomain system_data_file:dir write;
Jeff Vander Stoep67896ee2020-04-02 13:36:17 +020031# Apps should not be reading vendor-defined properties.
32dontaudit appdomain vendor_default_prop:file read;
Jeff Vander Stoep607bc672019-12-16 10:59:03 +010033
Nathan Haroldee268642017-12-14 18:20:30 -080034neverallow appdomain system_server:udp_socket {
Nathan Harold252b0152018-03-27 06:34:54 -070035 accept append bind create ioctl listen lock name_bind
36 relabelfrom relabelto setattr shutdown };
Nick Kralevich1e5021c2018-11-28 17:50:24 -080037
38# Transition to a non-app domain.
39# Exception for the shell and su domains, can transition to runas, etc.
Nick Kralevich0eb0a162018-12-12 09:06:05 -080040# Exception for crash_dump to allow for app crash reporting.
41# Exception for renderscript binaries (/system/bin/bcc, /system/bin/ld.mc)
42# to allow renderscript to create privileged executable files.
43neverallow { appdomain -shell userdebug_or_eng(`-su') }
44 { domain -appdomain -crash_dump -rs }:process { transition };
45neverallow { appdomain -shell userdebug_or_eng(`-su') }
46 { domain -appdomain }:process { dyntransition };
Daniel Rosenbergafede842020-05-11 22:50:40 -070047
48# Don't allow regular apps access to storage configuration properties.
49neverallow { appdomain -mediaprovider_app } storage_config_prop:file no_rw_file_perms;
Peiyong Lin37dea072020-06-03 12:20:41 -070050
51# Allow to read graphics related properties.
52get_prop(appdomain, graphics_config_prop)