Skip to content
Browse files
init.te: delete kernel load policy support
Remove the ability to dynamically update SELinux policy on the

1) This functionality has never been used, so we have no idea if
it works or not.

2) If system_server is compromised, this functionality allows a
complete bypass of the SELinux policy on the device. In particular,
an attacker can force a regression of the following patch
see also

3) Dynamic policy update can be used to bypass neverallow protections
enforced in CTS, by pushing a policy to the device after certification.
Such an updated policy could bring the device out of compliance or
deliberately introduce security weaknesses.

Bug: 22885422
Bug: 8949824
Change-Id: Id98b5e09d79254816d920b92003efe8dcbe6cd2e
  • Loading branch information
nickkral committed Aug 2, 2015
1 parent 301555e commit 356df32778732aa576e15071bf2736fbbd778b77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
@@ -208,11 +208,10 @@ neverallow domain self:capability2 mac_override;
# Only recovery needs mac_admin to set contexts not defined in current policy.
neverallow { domain -recovery } self:capability2 mac_admin;

# Only init should be able to load SELinux policies.
# Nobody should be able to load a new SELinux policy.
# The first load technically occurs while still in the kernel domain,
# but this does not trigger a denial since there is no policy yet.
# Policy reload requires allowing this to the init domain.
neverallow { domain -init } kernel:security load_policy;
neverallow domain kernel:security load_policy;

# Only init and the system_server can set selinux.reload_policy 1
# to trigger a policy reload.
@@ -123,7 +123,6 @@ allow init security_file:dir { create setattr };

# 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
# or a read that consumes the messages that were read.

0 comments on commit 356df32

Please sign in to comment.