Skip to content
Snippets Groups Projects
Commit e1a736a0 authored by Sandeep Patil's avatar Sandeep Patil Committed by android-build-merger
Browse files

sepolicy: restrict /vendor/overlay from most coredomains am: 9075699a

am: d4a96aac

Change-Id: I89f24a3ba1ca855aba0731f8320aeac93e7bcb66
parents a2aa513f d4a96aac
No related branches found
No related tags found
No related merge requests found
...@@ -98,6 +98,9 @@ allow appdomain system_file:lnk_file { getattr open read }; ...@@ -98,6 +98,9 @@ allow appdomain system_file:lnk_file { getattr open read };
# apps which cannot be in /vendor. # apps which cannot be in /vendor.
r_dir_file({ appdomain -ephemeral_app -untrusted_v2_app }, vendor_app_file) r_dir_file({ appdomain -ephemeral_app -untrusted_v2_app }, vendor_app_file)
# Allow apps access to /vendor/overlay
r_dir_file(appdomain, vendor_overlay_file)
# Execute dex2oat when apps call dexclassloader # Execute dex2oat when apps call dexclassloader
allow appdomain dex2oat_exec:file rx_file_perms; allow appdomain dex2oat_exec:file rx_file_perms;
......
...@@ -298,6 +298,9 @@ allow system_server apk_tmp_file:file create_file_perms; ...@@ -298,6 +298,9 @@ allow system_server apk_tmp_file:file create_file_perms;
# Access /vendor/app # Access /vendor/app
r_dir_file(system_server, vendor_app_file) r_dir_file(system_server, vendor_app_file)
# Access /vendor/app
r_dir_file(system_server, vendor_overlay_file)
# Manage /data/app-private. # Manage /data/app-private.
allow system_server apk_private_data_file:dir create_dir_perms; allow system_server apk_private_data_file:dir create_dir_perms;
allow system_server apk_private_data_file:file create_file_perms; allow system_server apk_private_data_file:file create_file_perms;
......
...@@ -51,6 +51,10 @@ allow { zygote with_dexpreopt(`-zygote') } dalvikcache_data_file:file execute; ...@@ -51,6 +51,10 @@ allow { zygote with_dexpreopt(`-zygote') } dalvikcache_data_file:file execute;
allow zygote idmap_exec:file rx_file_perms; allow zygote idmap_exec:file rx_file_perms;
allow zygote dex2oat_exec:file rx_file_perms; allow zygote dex2oat_exec:file rx_file_perms;
# /vendor/overlay existence is checked before
# passing it on as an argument to idmap in AssetManager
allow zygote vendor_overlay_file:dir { getattr open read search };
# Control cgroups. # Control cgroups.
allow zygote cgroup:dir create_dir_perms; allow zygote cgroup:dir create_dir_perms;
allow zygote cgroup:{ file lnk_file } r_file_perms; allow zygote cgroup:{ file lnk_file } r_file_perms;
......
...@@ -136,11 +136,6 @@ full_treble_only(` ...@@ -136,11 +136,6 @@ full_treble_only(`
# TODO: b/36806861 # TODO: b/36806861
allow domain vendor_app_file:lnk_file { open read }; allow domain vendor_app_file:lnk_file { open read };
# TODO: b/36656392, find out who needs access and only allow
# specific domains.
allow domain vendor_overlay_file:dir r_dir_perms;
allow domain vendor_overlay_file:file { read open getattr };
# TODO: b/36680116, find out who neeeds access and only allow # TODO: b/36680116, find out who neeeds access and only allow
# specific domains # specific domains
allow domain vendor_framework_file:dir r_dir_perms; allow domain vendor_framework_file:dir r_dir_perms;
...@@ -687,7 +682,7 @@ full_treble_only(` ...@@ -687,7 +682,7 @@ full_treble_only(`
# On TREBLE devices, a limited set of files in /vendor are accessible to # On TREBLE devices, a limited set of files in /vendor are accessible to
# only a few whitelisted coredomains to keep system/vendor separation. # only a few whitelisted coredomains to keep system/vendor separation.
full_treble_only(` full_treble_only(`
# Limit access to /vendor/app except for whitelisted domains # Limit access to /vendor/app
neverallow { neverallow {
coredomain coredomain
-appdomain -appdomain
...@@ -707,6 +702,25 @@ full_treble_only(` ...@@ -707,6 +702,25 @@ full_treble_only(`
-installd -installd
-system_server -system_server
} vendor_app_file:{ file lnk_file } r_file_perms; } vendor_app_file:{ file lnk_file } r_file_perms;
# Limit access to /vendor/overlay
neverallow {
coredomain
-appdomain
-idmap
-init
-system_server
-zygote
} vendor_overlay_file:dir { getattr open read search };
neverallow {
coredomain
-appdomain
-idmap
-init
-system_server
-zygote
} vendor_overlay_file:{ file lnk_file } r_file_perms;
') ')
# Only authorized processes should be writing to files in /data/dalvik-cache # Only authorized processes should be writing to files in /data/dalvik-cache
......
...@@ -12,3 +12,6 @@ allow idmap apk_data_file:dir search; ...@@ -12,3 +12,6 @@ allow idmap apk_data_file:dir search;
# Allow apps access to /vendor/app # Allow apps access to /vendor/app
r_dir_file(idmap, vendor_app_file) r_dir_file(idmap, vendor_app_file)
# Allow apps access to /vendor/overlay
r_dir_file(idmap, vendor_overlay_file)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment