Skip to content
Snippets Groups Projects
Commit 1e149967 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

seapp_context: explicitly label all seapp context files


seapp_context files need to be explicitly labeled as they are now split
cross system and vendor and won't have the generic world readable
'system_file' label.

Bug: 36002414
Test: no new 'seapp_context' denials at boot complete on sailfish
Test: successfully booted into recovery without denials and sideloaded
      OTA update.
Test: ./cts-tradefed run singleCommand cts --skip-device-info \
      --skip-preconditions --skip-connectivity-check --abi \
      arm64-v8a --module CtsSecurityHostTestCases -t \
      android.security.cts.SELinuxHostTest#testAospSeappContexts
Test: Launch 'chrome' and succesfully load a website.
Test: Launch Camera and take a picture.
Test: Launch Camera and record a video, succesfully playback recorded
      video

Change-Id: I19b3e50c6a7c292713d3e56ef0448acf6e4270f7
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent c9cf7361
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,7 @@ allow adbd selinuxfs:file r_file_perms; ...@@ -102,6 +102,7 @@ allow adbd selinuxfs:file r_file_perms;
allow adbd kernel:security read_policy; allow adbd kernel:security read_policy;
allow adbd service_contexts_file:file r_file_perms; allow adbd service_contexts_file:file r_file_perms;
allow adbd file_contexts_file:file r_file_perms; allow adbd file_contexts_file:file r_file_perms;
allow adbd seapp_contexts_file:file r_file_perms;
allow adbd surfaceflinger_service:service_manager find; allow adbd surfaceflinger_service:service_manager find;
allow adbd bootchart_data_file:dir search; allow adbd bootchart_data_file:dir search;
......
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
/plat_sepolicy\.cil u:object_r:rootfs:s0 /plat_sepolicy\.cil u:object_r:rootfs:s0
/plat_property_contexts u:object_r:property_contexts_file:s0 /plat_property_contexts u:object_r:property_contexts_file:s0
/nonplat_property_contexts u:object_r:property_contexts_file:s0 /nonplat_property_contexts u:object_r:property_contexts_file:s0
/seapp_contexts u:object_r:rootfs:s0 /seapp_contexts u:object_r:seapp_contexts_file:s0
/nonplat_seapp_contexts u:object_r:rootfs:s0 /nonplat_seapp_contexts u:object_r:seapp_contexts_file:s0
/plat_seapp_contexts u:object_r:rootfs:s0 /plat_seapp_contexts u:object_r:seapp_contexts_file:s0
/sepolicy u:object_r:rootfs:s0 /sepolicy u:object_r:rootfs:s0
/plat_service_contexts u:object_r:service_contexts_file:s0 /plat_service_contexts u:object_r:service_contexts_file:s0
/nonplat_service_contexts u:object_r:service_contexts_file:s0 /nonplat_service_contexts u:object_r:service_contexts_file:s0
...@@ -252,6 +252,7 @@ ...@@ -252,6 +252,7 @@
/system/etc/selinux/plat_property_contexts u:object_r:property_contexts_file:s0 /system/etc/selinux/plat_property_contexts u:object_r:property_contexts_file:s0
/system/etc/selinux/plat_service_contexts u:object_r:service_contexts_file:s0 /system/etc/selinux/plat_service_contexts u:object_r:service_contexts_file:s0
/system/etc/selinux/plat_file_contexts u:object_r:file_contexts_file:s0 /system/etc/selinux/plat_file_contexts u:object_r:file_contexts_file:s0
/system/etc/selinux/plat_seapp_contexts u:object_r:seapp_contexts_file:s0
############################# #############################
# Vendor files # Vendor files
...@@ -260,6 +261,7 @@ ...@@ -260,6 +261,7 @@
/vendor/etc/selinux/nonplat_property_contexts u:object_r:property_contexts_file:s0 /vendor/etc/selinux/nonplat_property_contexts u:object_r:property_contexts_file:s0
/vendor/etc/selinux/nonplat_service_contexts u:object_r:service_contexts_file:s0 /vendor/etc/selinux/nonplat_service_contexts u:object_r:service_contexts_file:s0
/vendor/etc/selinux/nonplat_file_contexts u:object_r:file_contexts_file:s0 /vendor/etc/selinux/nonplat_file_contexts u:object_r:file_contexts_file:s0
/vendor/etc/selinux/nonplat_seapp_contexts u:object_r:seapp_contexts_file:s0
############################# #############################
# OEM and ODM files # OEM and ODM files
......
...@@ -10,9 +10,6 @@ typeattribute webview_zygote mlstrustedsubject; ...@@ -10,9 +10,6 @@ typeattribute webview_zygote mlstrustedsubject;
# resulting process into webview_zygote domain. # resulting process into webview_zygote domain.
init_daemon_domain(webview_zygote) init_daemon_domain(webview_zygote)
# Access to system files for SELinux contexts.
allow webview_zygote rootfs:file r_file_perms;
# Allow reading/executing installed binaries to enable preloading the # Allow reading/executing installed binaries to enable preloading the
# installed WebView implementation. # installed WebView implementation.
allow webview_zygote apk_data_file:dir r_dir_perms; allow webview_zygote apk_data_file:dir r_dir_perms;
...@@ -46,6 +43,8 @@ allow webview_zygote system_server:process getpgid; ...@@ -46,6 +43,8 @@ allow webview_zygote system_server:process getpgid;
# Interaction between the webview_zygote and its children. # Interaction between the webview_zygote and its children.
allow webview_zygote isolated_app:process setpgid; allow webview_zygote isolated_app:process setpgid;
# Get seapp_contexts
allow webview_zygote seapp_contexts_file:file r_file_perms;
# Check validity of SELinux context before use. # Check validity of SELinux context before use.
selinux_check_context(webview_zygote) selinux_check_context(webview_zygote)
# Check SELinux permissions. # Check SELinux permissions.
......
...@@ -62,6 +62,8 @@ allow zygote self:capability sys_admin; ...@@ -62,6 +62,8 @@ allow zygote self:capability sys_admin;
allow zygote pmsg_device:chr_file getattr; allow zygote pmsg_device:chr_file getattr;
allow zygote debugfs_trace_marker:file getattr; allow zygote debugfs_trace_marker:file getattr;
# Get seapp_contexts
allow zygote seapp_contexts_file:file r_file_perms;
# Check validity of SELinux context before use. # Check validity of SELinux context before use.
selinux_check_context(zygote) selinux_check_context(zygote)
# Check SELinux permissions. # Check SELinux permissions.
......
...@@ -262,6 +262,9 @@ type file_contexts_file, file_type; ...@@ -262,6 +262,9 @@ type file_contexts_file, file_type;
# property_contexts file # property_contexts file
type property_contexts_file, file_type; type property_contexts_file, file_type;
# seapp_contexts file
type seapp_contexts_file, file_type;
# service_contexts file # service_contexts file
type service_contexts_file, file_type; type service_contexts_file, file_type;
......
...@@ -29,6 +29,8 @@ r_dir_file(installd, rootfs) ...@@ -29,6 +29,8 @@ r_dir_file(installd, rootfs)
r_dir_file(installd, system_file) r_dir_file(installd, system_file)
# Get file context # Get file context
allow installd file_contexts_file:file r_file_perms; allow installd file_contexts_file:file r_file_perms;
# Get seapp_context
allow installd seapp_contexts_file:file r_file_perms;
# Search /data/app-asec and stat files in it. # Search /data/app-asec and stat files in it.
allow installd asec_image_file:dir search; allow installd asec_image_file:dir search;
......
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