Skip to content
Snippets Groups Projects
Commit c1462504 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sepolicy: Fix asanwrapper"

parents a70e6a01 c848d37d
No related branches found
No related tags found
No related merge requests found
...@@ -315,6 +315,9 @@ allow appdomain adbd:unix_stream_socket { getattr getopt ioctl read write shutdo ...@@ -315,6 +315,9 @@ allow appdomain adbd:unix_stream_socket { getattr getopt ioctl read write shutdo
allow appdomain cache_file:dir getattr; allow appdomain cache_file:dir getattr;
# Allow apps to run with asanwrapper.
with_asan(`allow appdomain asanwrapper_exec:file rx_file_perms;')
### ###
### Neverallow rules ### Neverallow rules
### ###
......
...@@ -3,3 +3,7 @@ ...@@ -3,3 +3,7 @@
/data/asan/vendor/lib(/.*)? u:object_r:system_file:s0 /data/asan/vendor/lib(/.*)? u:object_r:system_file:s0
/data/asan/vendor/lib64(/.*)? u:object_r:system_file:s0 /data/asan/vendor/lib64(/.*)? u:object_r:system_file:s0
/system/bin/asan_extract u:object_r:asan_extract_exec:s0 /system/bin/asan_extract u:object_r:asan_extract_exec:s0
/system/bin/asanwrapper u:object_r:asanwrapper_exec:s0
/system/bin/asan/app_process u:object_r:zygote_exec:s0
/system/bin/asan/app_process32 u:object_r:zygote_exec:s0
/system/bin/asan/app_process64 u:object_r:zygote_exec:s0
...@@ -22,6 +22,9 @@ userdebug_or_eng(` ...@@ -22,6 +22,9 @@ userdebug_or_eng(`
# Report dalvikcache_data_file:file execute violations. # Report dalvikcache_data_file:file execute violations.
auditallow system_server dalvikcache_data_file:file execute; auditallow system_server dalvikcache_data_file:file execute;
') ')
# When running system server under --invoke-with, we'll try to load the boot image under the
# system server domain, following links to the system partition.
with_asan(`allow system_server dalvikcache_data_file:lnk_file r_file_perms;')
# /data/resource-cache # /data/resource-cache
allow system_server resourcecache_data_file:file r_file_perms; allow system_server resourcecache_data_file:file r_file_perms;
...@@ -655,6 +658,7 @@ allow system_server debugfs_wifi_tracing:file rw_file_perms; ...@@ -655,6 +658,7 @@ allow system_server debugfs_wifi_tracing:file rw_file_perms;
# asanwrapper. # asanwrapper.
with_asan(` with_asan(`
allow system_server shell_exec:file rx_file_perms; allow system_server shell_exec:file rx_file_perms;
allow system_server asanwrapper_exec:file rx_file_perms;
') ')
### ###
...@@ -682,7 +686,7 @@ neverallow system_server { ...@@ -682,7 +686,7 @@ neverallow system_server {
file_type file_type
-toolbox_exec -toolbox_exec
-logcat_exec -logcat_exec
with_asan(`-shell_exec') with_asan(`-shell_exec -asanwrapper_exec -zygote_exec')
}:file execute_no_trans; }:file execute_no_trans;
# Ensure that system_server doesn't perform any domain transitions other than # Ensure that system_server doesn't perform any domain transitions other than
......
...@@ -221,6 +221,9 @@ allow { domain -domain } hwservice_manager_type:hwservice_manager { add find }; ...@@ -221,6 +221,9 @@ allow { domain -domain } hwservice_manager_type:hwservice_manager { add find };
# when it's not explicitly used in allow rules # when it's not explicitly used in allow rules
allow { domain -domain } vndservice_manager_type:service_manager { add find }; allow { domain -domain } vndservice_manager_type:service_manager { add find };
# Under ASAN, processes will try to read /data, as the sanitized libraries are there.
with_asan(`allow domain system_data_file:dir getattr;')
### ###
### neverallow rules ### neverallow rules
### ###
......
...@@ -315,6 +315,9 @@ allow dev_type tmpfs:filesystem associate; ...@@ -315,6 +315,9 @@ allow dev_type tmpfs:filesystem associate;
allow app_fuse_file app_fusefs:filesystem associate; allow app_fuse_file app_fusefs:filesystem associate;
allow postinstall_file self:filesystem associate; allow postinstall_file self:filesystem associate;
# asanwrapper (run a sanitized app_process, to be used with wrap properties)
with_asan(`type asanwrapper_exec, exec_type, file_type;')
# It's a bug to assign the file_type attribute and fs_type attribute # It's a bug to assign the file_type attribute and fs_type attribute
# to any type. Do not allow it. # to any type. Do not allow it.
# #
......
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