Skip to content
Snippets Groups Projects
Commit 2637198f authored by Nick Kralevich's avatar Nick Kralevich
Browse files

Only init should be able to load a security policy

Bug: 9859477
Change-Id: Iadd26cac2f318b81701310788bed795dadfa5b6b
parent 8a2ebe34
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ neverallow { appdomain -unconfineddomain } kmem_device:chr_file { read write }; ...@@ -138,7 +138,7 @@ neverallow { appdomain -unconfineddomain } kmem_device:chr_file { read write };
neverallow { appdomain -unconfineddomain } kernel:security { setenforce setbool }; neverallow { appdomain -unconfineddomain } kernel:security { setenforce setbool };
# Load security policy. # Load security policy.
neverallow { appdomain -unconfineddomain } kernel:security load_policy; neverallow appdomain kernel:security load_policy;
# Privileged netlink socket interfaces. # Privileged netlink socket interfaces.
neverallow { appdomain -unconfineddomain } neverallow { appdomain -unconfineddomain }
......
...@@ -135,3 +135,10 @@ allow domain unlabeled:file { create_file_perms rwx_file_perms relabelfrom }; ...@@ -135,3 +135,10 @@ allow domain unlabeled:file { create_file_perms rwx_file_perms relabelfrom };
allow domain unlabeled:dir { create_dir_perms relabelfrom }; allow domain unlabeled:dir { create_dir_perms relabelfrom };
allow domain unlabeled:lnk_file { create_file_perms }; allow domain unlabeled:lnk_file { create_file_perms };
neverallow { domain -relabeltodomain } *:dir_file_class_set relabelto; neverallow { domain -relabeltodomain } *:dir_file_class_set relabelto;
###
### neverallow rules
###
# Only init should be able to load SELinux policies
neverallow { domain -init } kernel:security load_policy;
...@@ -9,3 +9,4 @@ relabelto_domain(init) ...@@ -9,3 +9,4 @@ relabelto_domain(init)
allow init unlabeled:filesystem mount; allow init unlabeled:filesystem mount;
allow init {fs_type dev_type file_type}:dir_file_class_set relabelto; allow init {fs_type dev_type file_type}:dir_file_class_set relabelto;
allow init kernel:security load_policy;
allow unconfineddomain self:capability_class_set *; allow unconfineddomain self:capability_class_set *;
allow unconfineddomain kernel:security *; allow unconfineddomain kernel:security ~load_policy;
allow unconfineddomain kernel:system *; allow unconfineddomain kernel:system *;
allow unconfineddomain self:memprotect *; allow unconfineddomain self:memprotect *;
allow unconfineddomain domain:process *; allow unconfineddomain domain:process *;
......
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