diff --git a/domain.te b/domain.te index b2eaa79057b07e0b23a7b5b2821052464003394c..733a0952341cbd79271afb7b334b76d9483b5c8a 100644 --- a/domain.te +++ b/domain.te @@ -369,3 +369,8 @@ neverallow domain domain:{ shm sem msg msgq } *; # Do not mount on top of symlinks, fifos, or sockets. # Feature parity with Chromium LSM. neverallow domain { file_type fs_type dev_type }:{ lnk_file fifo_file sock_file } mounton; + +# Nobody should be able to execute su on user builds. +# On userdebug/eng builds, only dumpstate, shell, and +# su itself execute su. +neverallow { domain userdebug_or_eng(`-dumpstate -shell -su') } su_exec:file no_x_file_perms;