Merge "Allow init to use binder."
diff --git a/public/domain.te b/public/domain.te
index deccae3..d0c7063 100644
--- a/public/domain.te
+++ b/public/domain.te
@@ -397,9 +397,11 @@
# No domain should be allowed to ptrace init.
neverallow * init:process ptrace;
-# Init can't do anything with binder calls. If this neverallow rule is being
-# triggered, it's probably due to a service with no SELinux domain.
-neverallow * init:binder *;
+# Nobody is allowed to make binder calls into init.
+# Only servicemanager may transfer binder references to init
+# vendor_init shouldn't use binder at all.
+neverallow * init:binder ~{ transfer };
+neverallow { domain -servicemanager } init:binder { transfer };
neverallow * vendor_init:binder *;
# Don't allow raw read/write/open access to block_device
diff --git a/public/init.te b/public/init.te
index d3a3b1f..d062195 100644
--- a/public/init.te
+++ b/public/init.te
@@ -512,6 +512,9 @@
allow init vold_metadata_file:dir create_dir_perms;
allow init vold_metadata_file:file getattr;
+# Allow init to use binder
+binder_use(init);
+
###
### neverallow rules
###