Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemSEPolicy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemSEPolicy
Commits
a2aa513f
Commit
a2aa513f
authored
7 years ago
by
Sandeep Patil
Committed by
android-build-merger
7 years ago
Browse files
Options
Downloads
Plain Diff
sepolicy: restrict /vendor/app from most coredomains am:
1b5f81a2
am:
ec5e26e4
Change-Id: Ie791b20d2ae2e2690846f18fa0bc74926990bdbc
parents
cb18d37d
ec5e26e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
private/app.te
+4
-0
4 additions, 0 deletions
private/app.te
public/dex2oat.te
+2
-0
2 additions, 0 deletions
public/dex2oat.te
public/domain.te
+26
-5
26 additions, 5 deletions
public/domain.te
public/idmap.te
+3
-0
3 additions, 0 deletions
public/idmap.te
public/installd.te
+2
-0
2 additions, 0 deletions
public/installd.te
with
37 additions
and
5 deletions
private/app.te
+
4
−
0
View file @
a2aa513f
...
@@ -94,6 +94,10 @@ allow { appdomain -ephemeral_app -untrusted_v2_app } toolbox_exec:file rx_file_p
...
@@ -94,6 +94,10 @@ allow { appdomain -ephemeral_app -untrusted_v2_app } toolbox_exec:file rx_file_p
allow appdomain system_file:dir r_dir_perms;
allow appdomain system_file:dir r_dir_perms;
allow appdomain system_file:lnk_file { getattr open read };
allow appdomain system_file:lnk_file { getattr open read };
# Allow apps access to /vendor/app except for privileged
# apps which cannot be in /vendor.
r_dir_file({ appdomain -ephemeral_app -untrusted_v2_app }, vendor_app_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;
...
...
This diff is collapsed.
Click to expand it.
public/dex2oat.te
+
2
−
0
View file @
a2aa513f
...
@@ -3,6 +3,8 @@ type dex2oat, domain, domain_deprecated;
...
@@ -3,6 +3,8 @@ type dex2oat, domain, domain_deprecated;
type dex2oat_exec, exec_type, file_type;
type dex2oat_exec, exec_type, file_type;
r_dir_file(dex2oat, apk_data_file)
r_dir_file(dex2oat, apk_data_file)
# Access to /vendor/app
r_dir_file(dex2oat, vendor_app_file)
allow dex2oat tmpfs:file { read getattr };
allow dex2oat tmpfs:file { read getattr };
...
...
This diff is collapsed.
Click to expand it.
public/domain.te
+
26
−
5
View file @
a2aa513f
...
@@ -131,11 +131,6 @@ full_treble_only(`
...
@@ -131,11 +131,6 @@ full_treble_only(`
# through linker/loader.
# through linker/loader.
allow domain vendor_file:dir { getattr search };
allow domain vendor_file:dir { getattr search };
# TODO: b/36681210, find out who needs access and only allow
# specific domains for Treble
allow domain vendor_app_file:dir r_dir_perms;
allow domain vendor_app_file:file { read open getattr };
# Some apps (com.android.phone) need to be able to open
# Some apps (com.android.phone) need to be able to open
# symlinked libraries
# symlinked libraries
# TODO: b/36806861
# TODO: b/36806861
...
@@ -689,6 +684,31 @@ full_treble_only(`
...
@@ -689,6 +684,31 @@ full_treble_only(`
}:sock_file ~{ append getattr ioctl read write };
}:sock_file ~{ append getattr ioctl read write };
')
')
# 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 except for whitelisted domains
neverallow {
coredomain
-appdomain
-dex2oat
-idmap
-init
-installd
-system_server
} vendor_app_file:dir { open read getattr search };
neverallow {
coredomain
-appdomain
-dex2oat
-idmap
-init
-installd
-system_server
} vendor_app_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
neverallow {
neverallow {
domain
domain
...
@@ -908,6 +928,7 @@ neverallow {
...
@@ -908,6 +928,7 @@ neverallow {
userdebug_or_eng(`-uncrypt')
userdebug_or_eng(`-uncrypt')
} shell_data_file:file open;
} shell_data_file:file open;
# servicemanager is the only process which handles list request
# servicemanager is the only process which handles list request
neverallow * ~servicemanager:service_manager list;
neverallow * ~servicemanager:service_manager list;
...
...
This diff is collapsed.
Click to expand it.
public/idmap.te
+
3
−
0
View file @
a2aa513f
...
@@ -9,3 +9,6 @@ allow idmap resourcecache_data_file:file { getattr read write };
...
@@ -9,3 +9,6 @@ allow idmap resourcecache_data_file:file { getattr read write };
# Open and read from target and overlay apk files passed by argument.
# Open and read from target and overlay apk files passed by argument.
allow idmap apk_data_file:file r_file_perms;
allow idmap apk_data_file:file r_file_perms;
allow idmap apk_data_file:dir search;
allow idmap apk_data_file:dir search;
# Allow apps access to /vendor/app
r_dir_file(idmap, vendor_app_file)
This diff is collapsed.
Click to expand it.
public/installd.te
+
2
−
0
View file @
a2aa513f
...
@@ -27,6 +27,8 @@ selinux_check_context(installd)
...
@@ -27,6 +27,8 @@ selinux_check_context(installd)
r_dir_file(installd, rootfs)
r_dir_file(installd, rootfs)
# Scan through APKs in /system/app and /system/priv-app
# Scan through APKs in /system/app and /system/priv-app
r_dir_file(installd, system_file)
r_dir_file(installd, system_file)
# Scan through APKs in /vendor/app
r_dir_file(installd, vendor_app_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
# Get seapp_context
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment