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
7ac88000
Commit
7ac88000
authored
10 years ago
by
Stephen Smalley
Committed by
Android Git Automerger
10 years ago
Browse files
Options
Downloads
Plain Diff
am
3235f61a
: Restrict /data/security and setprop selinux.reload_policy access.
* commit '
3235f61a
': Restrict /data/security and setprop selinux.reload_policy access.
parents
ffbba62e
3235f61a
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
app.te
+0
-3
0 additions, 3 deletions
app.te
domain.te
+17
-0
17 additions, 0 deletions
domain.te
init.te
+7
-0
7 additions, 0 deletions
init.te
property_contexts
+0
-3
0 additions, 3 deletions
property_contexts
unconfined.te
+3
-3
3 additions, 3 deletions
unconfined.te
with
27 additions
and
9 deletions
app.te
+
0
−
3
View file @
7ac88000
...
...
@@ -268,9 +268,6 @@ neverallow { appdomain -unconfineddomain -system_app }
{ create write setattr relabelfrom relabelto append unlink link rename };
# Write to various other parts of /data.
neverallow { appdomain -system_app -unconfineddomain }
security_file:dir_file_class_set
{ create write setattr relabelfrom relabelto append unlink link rename };
neverallow { appdomain -unconfineddomain } drm_data_file:dir_file_class_set
{ create write setattr relabelfrom relabelto append unlink link rename };
neverallow { appdomain -unconfineddomain } gps_data_file:dir_file_class_set
...
...
This diff is collapsed.
Click to expand it.
domain.te
+
17
−
0
View file @
7ac88000
...
...
@@ -189,6 +189,23 @@ neverallow { domain -recovery } self:capability2 mac_admin;
# Policy reload requires allowing this to the init domain.
neverallow { domain -init } kernel:security load_policy;
# Only init and the system_server can set selinux.reload_policy 1
# to trigger a policy reload.
neverallow { domain -init -system_server } security_prop:property_service set;
# Only init and system_server can write to /data/security, where runtime
# policy updates live.
# Only init can relabel /data/security (for init.rc restorecon_recursive /data).
neverallow { domain -init } security_file:{ dir file lnk_file } { relabelfrom relabelto };
# Only init and system_server can create/setattr directories with this type.
# init is for init.rc mkdir /data/security.
# system_server is for creating subdirectories under /data/security.
neverallow { domain -init -system_server } security_file:dir { create setattr };
# Only system_server can create subdirectories and files under /data/security.
neverallow { domain -system_server } security_file:dir { rename write add_name remove_name rmdir };
neverallow { domain -system_server } security_file:file { create setattr write append unlink link rename };
neverallow { domain -system_server } security_file:lnk_file { create setattr unlink rename };
# Only init prior to switching context should be able to set enforcing mode.
# init starts in kernel domain and switches to init domain via setcon in
# the init.rc, so the setenforce occurs while still in kernel. After
...
...
This diff is collapsed.
Click to expand it.
init.te
+
7
−
0
View file @
7ac88000
...
...
@@ -23,7 +23,14 @@ allow init {file_type -system_file -exec_type}:dir_file_class_set relabelto;
allow init unlabeled:dir { create_dir_perms relabelfrom };
allow init unlabeled:notdevfile_class_set { create_file_perms relabelfrom };
# Create /data/security from init.rc post-fs-data.
allow init security_file:dir { create setattr };
# setprop selinux.reload_policy 1 from init.rc post-fs-data.
allow init security_prop:property_service set;
# Reload policy upon setprop selinux.reload_policy 1.
r_dir_file(init, security_file)
allow init kernel:security load_policy;
# Any operation that can modify the kernel ring buffer, e.g. clear
...
...
This diff is collapsed.
Click to expand it.
property_contexts
+
0
−
3
View file @
7ac88000
...
...
@@ -39,9 +39,6 @@ persist.service. u:object_r:system_prop:s0
persist.service.bdroid. u:object_r:bluetooth_prop:s0
persist.security. u:object_r:system_prop:s0
# mmac persistent properties
persist.mmac. u:object_r:security_prop:s0
# selinux non-persistent properties
selinux. u:object_r:security_prop:s0
...
...
This diff is collapsed.
Click to expand it.
unconfined.te
+
3
−
3
View file @
7ac88000
...
...
@@ -29,13 +29,13 @@ allow unconfineddomain domain:socket_class_set *;
allow unconfineddomain domain:ipc_class_set *;
allow unconfineddomain domain:key *;
allow unconfineddomain {fs_type dev_type}:{ dir lnk_file sock_file fifo_file } ~relabelto;
allow unconfineddomain {file_type -keystore_data_file -property_data_file -system_file -exec_type}:{ dir lnk_file sock_file fifo_file } ~relabelto;
allow unconfineddomain {file_type -keystore_data_file -property_data_file -system_file -exec_type
-security_file
}:{ dir lnk_file sock_file fifo_file } ~relabelto;
allow unconfineddomain exec_type:{ file dir lnk_file } ~{ create write setattr relabelfrom relabelto append unlink link rename };
allow unconfineddomain system_file:{ dir lnk_file } ~{ create write setattr relabelfrom relabelto append unlink link rename };
allow unconfineddomain system_file:file ~{ create write setattr relabelfrom relabelto append unlink link rename entrypoint };
allow unconfineddomain {fs_type -usermodehelper -proc_security}:{ chr_file file } ~{entrypoint execmod execute relabelto};
allow unconfineddomain {dev_type -kmem_device}:{ chr_file file } ~{entrypoint execmod execute relabelto};
allow unconfineddomain {file_type -keystore_data_file -property_data_file -system_file -exec_type}:{ chr_file file } ~{entrypoint execmod execute relabelto};
allow unconfineddomain {file_type -keystore_data_file -property_data_file -system_file -exec_type
-security_file
}:{ chr_file file } ~{entrypoint execmod execute relabelto};
allow unconfineddomain { rootfs system_file exec_type }:file execute;
allow unconfineddomain node_type:node *;
allow unconfineddomain node_type:{ tcp_socket udp_socket rawip_socket } node_bind;
...
...
@@ -44,4 +44,4 @@ allow unconfineddomain port_type:socket_class_set name_bind;
allow unconfineddomain port_type:{ tcp_socket dccp_socket } name_connect;
allow unconfineddomain domain:peer recv;
allow unconfineddomain { domain -init }:binder { call transfer set_context_mgr };
allow unconfineddomain property_type:property_service set;
allow unconfineddomain
{
property_type
-security_prop }
:property_service set;
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