Skip to content

Commit 356df32

Browse files
committed
init.te: delete kernel load policy support
Remove the ability to dynamically update SELinux policy on the device. 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 * https://android-review.googlesource.com/138510 see also https://code.google.com/p/android/issues/detail?id=181826 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
1 parent 301555e commit 356df32

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

domain.te

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,10 @@ neverallow domain self:capability2 mac_override;
208208
# Only recovery needs mac_admin to set contexts not defined in current policy.
209209
neverallow { domain -recovery } self:capability2 mac_admin;
210210

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

217216
# Only init and the system_server can set selinux.reload_policy 1
218217
# to trigger a policy reload.

init.te

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ allow init security_file:dir { create setattr };
123123

124124
# Reload policy upon setprop selinux.reload_policy 1.
125125
r_dir_file(init, security_file)
126-
allow init kernel:security load_policy;
127126

128127
# Any operation that can modify the kernel ring buffer, e.g. clear
129128
# or a read that consumes the messages that were read.

0 commit comments

Comments
 (0)