Skip to content
Snippets Groups Projects
Commit 4f0b721c authored by Tom Cherry's avatar Tom Cherry Committed by android-build-merger
Browse files

Prevent vendor_init from using binder or sockets am: a099830e

am: 40e15ab3

Change-Id: I486933e6d02f1905c31c336d12ee4e5bf9802d95
parents b695ad4e 40e15ab3
No related branches found
No related tags found
No related merge requests found
...@@ -389,6 +389,7 @@ neverallow * init:process ptrace; ...@@ -389,6 +389,7 @@ neverallow * init:process ptrace;
# Init can't do anything with binder calls. If this neverallow rule is being # 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. # triggered, it's probably due to a service with no SELinux domain.
neverallow * init:binder *; neverallow * init:binder *;
neverallow * vendor_init:binder *;
# Don't allow raw read/write/open access to block_device # Don't allow raw read/write/open access to block_device
# Rather force a relabel to a more specific type # Rather force a relabel to a more specific type
......
...@@ -12,6 +12,7 @@ allow servicemanager self:binder set_context_mgr; ...@@ -12,6 +12,7 @@ allow servicemanager self:binder set_context_mgr;
allow servicemanager { allow servicemanager {
domain domain
-init -init
-vendor_init
-hwservicemanager -hwservicemanager
-vndservicemanager -vndservicemanager
}:binder transfer; }:binder transfer;
......
...@@ -4,6 +4,9 @@ type vendor_init, domain, mlstrustedsubject; ...@@ -4,6 +4,9 @@ type vendor_init, domain, mlstrustedsubject;
# Communication to the main init process # Communication to the main init process
allow vendor_init init:unix_stream_socket { read write }; allow vendor_init init:unix_stream_socket { read write };
# Vendor init shouldn't communicate with any vendor process, nor most system processes.
neverallow_establish_socket_comms(vendor_init, { domain -init -logd -su -vendor_init });
# Logging to kmsg # Logging to kmsg
allow vendor_init kmsg_device:chr_file { open write }; allow vendor_init kmsg_device:chr_file { open write };
......
...@@ -6,7 +6,7 @@ init_daemon_domain(vndservicemanager); ...@@ -6,7 +6,7 @@ init_daemon_domain(vndservicemanager);
allow vndservicemanager self:binder set_context_mgr; allow vndservicemanager self:binder set_context_mgr;
# transfer binder objects to other processes (TODO b/35870313 limit this to vendor-only) # transfer binder objects to other processes (TODO b/35870313 limit this to vendor-only)
allow vndservicemanager { domain -coredomain -init }:binder transfer; allow vndservicemanager { domain -coredomain -init -vendor_init }:binder transfer;
allow vndservicemanager vndbinder_device:chr_file rw_file_perms; allow vndservicemanager vndbinder_device:chr_file rw_file_perms;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment