2017-11-17 20:16:22 +01:00
|
|
|
get_prop(coredomain, pm_prop)
|
2017-10-19 09:54:49 +02:00
|
|
|
get_prop(coredomain, exported_pm_prop)
|
2017-12-21 01:27:53 +01:00
|
|
|
|
|
|
|
full_treble_only(`
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
2018-01-19 22:04:57 +01:00
|
|
|
|
|
|
|
# for chowning
|
2017-12-21 01:27:53 +01:00
|
|
|
-init
|
|
|
|
|
|
|
|
# generic access to sysfs_type
|
|
|
|
-ueventd
|
|
|
|
-vold
|
|
|
|
} sysfs_leds:file *;
|
|
|
|
')
|
2018-11-14 23:59:22 +01:00
|
|
|
|
2018-11-29 02:50:24 +01:00
|
|
|
# On TREBLE devices, a limited set of files in /vendor are accessible to
|
|
|
|
# only a few whitelisted coredomains to keep system/vendor separation.
|
|
|
|
full_treble_only(`
|
|
|
|
# Limit access to /vendor/app
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-appdomain
|
|
|
|
-dex2oat
|
|
|
|
-idmap
|
|
|
|
-init
|
|
|
|
-installd
|
|
|
|
userdebug_or_eng(`-perfprofd')
|
|
|
|
userdebug_or_eng(`-heapprofd')
|
|
|
|
-postinstall_dexopt
|
2018-12-12 18:06:05 +01:00
|
|
|
-rs # spawned by appdomain, so carryover the exception above
|
2018-11-29 02:50:24 +01:00
|
|
|
-system_server
|
|
|
|
} vendor_app_file:dir { open read getattr search };
|
|
|
|
')
|
|
|
|
|
|
|
|
full_treble_only(`
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-appdomain
|
|
|
|
-dex2oat
|
|
|
|
-idmap
|
|
|
|
-init
|
|
|
|
-installd
|
|
|
|
userdebug_or_eng(`-perfprofd')
|
|
|
|
userdebug_or_eng(`-heapprofd')
|
|
|
|
-postinstall_dexopt
|
2018-12-12 18:06:05 +01:00
|
|
|
-rs # spawned by appdomain, so carryover the exception above
|
2018-11-29 02:50:24 +01:00
|
|
|
-system_server
|
|
|
|
-mediaserver
|
|
|
|
} vendor_app_file:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
full_treble_only(`
|
|
|
|
# Limit access to /vendor/overlay
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-appdomain
|
|
|
|
-idmap
|
|
|
|
-init
|
|
|
|
-installd
|
2018-12-12 18:06:05 +01:00
|
|
|
-rs # spawned by appdomain, so carryover the exception above
|
2018-11-29 02:50:24 +01:00
|
|
|
-system_server
|
2018-11-05 11:39:15 +01:00
|
|
|
-app_zygote
|
2018-11-29 02:50:24 +01:00
|
|
|
-webview_zygote
|
|
|
|
-zygote
|
|
|
|
userdebug_or_eng(`-heapprofd')
|
|
|
|
} vendor_overlay_file:dir { getattr open read search };
|
|
|
|
')
|
|
|
|
|
|
|
|
full_treble_only(`
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-appdomain
|
|
|
|
-idmap
|
|
|
|
-init
|
|
|
|
-installd
|
2018-12-12 18:06:05 +01:00
|
|
|
-rs # spawned by appdomain, so carryover the exception above
|
2018-11-29 02:50:24 +01:00
|
|
|
-system_server
|
2018-11-05 11:39:15 +01:00
|
|
|
-app_zygote
|
2018-11-29 02:50:24 +01:00
|
|
|
-webview_zygote
|
|
|
|
-zygote
|
|
|
|
userdebug_or_eng(`-heapprofd')
|
|
|
|
} vendor_overlay_file:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2018-11-14 23:59:22 +01:00
|
|
|
# Core domains are not permitted to use kernel interfaces which are not
|
|
|
|
# explicitly labeled.
|
|
|
|
# TODO(b/65643247): Apply these neverallow rules to all coredomain.
|
|
|
|
full_treble_only(`
|
|
|
|
# /proc
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-vold
|
|
|
|
} proc:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# /sys
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-init
|
|
|
|
-ueventd
|
|
|
|
-vold
|
|
|
|
} sysfs:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# /dev
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-fsck
|
|
|
|
-init
|
|
|
|
-ueventd
|
|
|
|
} device:{ blk_file file } no_rw_file_perms;
|
|
|
|
|
|
|
|
# debugfs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-dumpstate
|
|
|
|
-init
|
|
|
|
-system_server
|
|
|
|
} debugfs:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# tracefs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-atrace
|
|
|
|
-dumpstate
|
|
|
|
-init
|
|
|
|
userdebug_or_eng(`-perfprofd')
|
|
|
|
-traced_probes
|
|
|
|
-shell
|
|
|
|
-traceur_app
|
|
|
|
} debugfs_tracing:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# inotifyfs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-init
|
|
|
|
} inotify:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# pstorefs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-bootstat
|
|
|
|
-charger
|
|
|
|
-dumpstate
|
|
|
|
-healthd
|
|
|
|
userdebug_or_eng(`-incidentd')
|
|
|
|
-init
|
|
|
|
-logd
|
|
|
|
-logpersist
|
|
|
|
-recovery_persist
|
|
|
|
-recovery_refresh
|
|
|
|
-shell
|
|
|
|
-system_server
|
|
|
|
} pstorefs:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# configfs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-init
|
|
|
|
-system_server
|
|
|
|
} configfs:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# functionfs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-adbd
|
|
|
|
-init
|
|
|
|
-mediaprovider
|
|
|
|
-system_server
|
|
|
|
} functionfs:file no_rw_file_perms;
|
|
|
|
|
|
|
|
# usbfs and binfmt_miscfs
|
|
|
|
neverallow {
|
|
|
|
coredomain
|
|
|
|
-init
|
|
|
|
}{ usbfs binfmt_miscfs }:file no_rw_file_perms;
|
|
|
|
')
|
2018-11-15 22:52:24 +01:00
|
|
|
|
2018-11-29 21:38:50 +01:00
|
|
|
# Following /dev nodes must not be directly accessed by coredomain, but should
|
|
|
|
# instead be wrapped by HALs.
|
|
|
|
neverallow coredomain {
|
|
|
|
iio_device
|
|
|
|
radio_device
|
|
|
|
}:chr_file { open read append write ioctl };
|
2019-01-10 01:37:04 +01:00
|
|
|
|
|
|
|
# TODO(b/120243891): HAL permission to tee_device is included into coredomain
|
|
|
|
# on non-Treble devices.
|
|
|
|
full_treble_only(`
|
|
|
|
neverallow coredomain tee_device:chr_file { open read append write ioctl };
|
|
|
|
')
|