Only allow system_server to send commands to zygote.

Add neverallow rules to ensure that zygote commands are only taken from
system_server.

Also remove the zygote policy class which was removed as an object manager in
commit: ccb3424639821b5ef85264bc5836451590e8ade7

Bug: 19624279

Change-Id: I1c925d7facf19b3953b5deb85d992415344c4c9f
This commit is contained in:
dcashman 2015-03-09 10:13:13 -07:00
parent 0560e75e4f
commit 8f81dcad5b
3 changed files with 4 additions and 11 deletions

View file

@ -876,14 +876,6 @@ class binder
transfer transfer
} }
class zygote
{
specifyids
specifyrlimits
specifyinvokewith
specifyseinfo
}
class property_service class property_service
{ {
set set

View file

@ -344,6 +344,10 @@ neverallow {
-dex2oat -dex2oat
} dalvikcache_data_file:file no_w_file_perms; } dalvikcache_data_file:file no_w_file_perms;
# Only system_server should be able to send commands via the zygote socket
neverallow { domain -zygote -system_server } zygote:unix_stream_socket connectto;
neverallow { domain -system_server } zygote_socket:sock_file write;
# Android does not support System V IPCs. # Android does not support System V IPCs.
# #
# The reason for this is due to the fact that, by design, they lead to global # The reason for this is due to the fact that, by design, they lead to global

View file

@ -296,9 +296,6 @@ allow system_server wpa_socket:sock_file unlink;
type_transition system_server system_data_file:sock_file system_ndebug_socket "ndebugsocket"; type_transition system_server system_data_file:sock_file system_ndebug_socket "ndebugsocket";
allow system_server system_ndebug_socket:sock_file create_file_perms; allow system_server system_ndebug_socket:sock_file create_file_perms;
# Specify any arguments to zygote.
allow system_server self:zygote { specifyids specifyrlimits specifyseinfo };
# Manage cache files. # Manage cache files.
allow system_server cache_file:dir { relabelfrom create_dir_perms }; allow system_server cache_file:dir { relabelfrom create_dir_perms };
allow system_server cache_file:file { relabelfrom create_file_perms }; allow system_server cache_file:file { relabelfrom create_file_perms };