Skip to content
Snippets Groups Projects
Commit 4dd14f69 authored by Martijn Coenen's avatar Martijn Coenen Committed by Gerrit Code Review
Browse files

Merge "Initial sepolicy for vndservicemanager."

parents d3ce5dc3 e7d8f4c3
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
/dev/usb_accessory u:object_r:usbaccessory_device:s0 /dev/usb_accessory u:object_r:usbaccessory_device:s0
/dev/vcs[0-9a-z]* u:object_r:vcs_device:s0 /dev/vcs[0-9a-z]* u:object_r:vcs_device:s0
/dev/video[0-9]* u:object_r:video_device:s0 /dev/video[0-9]* u:object_r:video_device:s0
/dev/vndbinder u:object_r:vndbinder_device:s0
/dev/watchdog u:object_r:watchdog_device:s0 /dev/watchdog u:object_r:watchdog_device:s0
/dev/xt_qtaguid u:object_r:qtaguid_device:s0 /dev/xt_qtaguid u:object_r:qtaguid_device:s0
/dev/zero u:object_r:zero_device:s0 /dev/zero u:object_r:zero_device:s0
......
...@@ -7,6 +7,7 @@ type audio_timer_device, dev_type; ...@@ -7,6 +7,7 @@ type audio_timer_device, dev_type;
type audio_seq_device, dev_type; type audio_seq_device, dev_type;
type binder_device, dev_type, mlstrustedobject; type binder_device, dev_type, mlstrustedobject;
type hwbinder_device, dev_type, mlstrustedobject; type hwbinder_device, dev_type, mlstrustedobject;
type vndbinder_device, dev_type;
type block_device, dev_type; type block_device, dev_type;
type camera_device, dev_type; type camera_device, dev_type;
type dm_device, dev_type; type dm_device, dev_type;
......
...@@ -66,8 +66,8 @@ allow domain owntty_device:chr_file rw_file_perms; ...@@ -66,8 +66,8 @@ allow domain owntty_device:chr_file rw_file_perms;
allow domain null_device:chr_file rw_file_perms; allow domain null_device:chr_file rw_file_perms;
allow domain zero_device:chr_file rw_file_perms; allow domain zero_device:chr_file rw_file_perms;
allow domain ashmem_device:chr_file rw_file_perms; allow domain ashmem_device:chr_file rw_file_perms;
allow { domain -hwservicemanager } binder_device:chr_file rw_file_perms; allow { domain -hwservicemanager -vndservicemanager } binder_device:chr_file rw_file_perms;
allow { domain -servicemanager } hwbinder_device:chr_file rw_file_perms; allow { domain -servicemanager -vndservicemanager } hwbinder_device:chr_file rw_file_perms;
allow domain ptmx_device:chr_file rw_file_perms; allow domain ptmx_device:chr_file rw_file_perms;
allow domain alarm_device:chr_file r_file_perms; allow domain alarm_device:chr_file r_file_perms;
allow domain random_device:chr_file rw_file_perms; allow domain random_device:chr_file rw_file_perms;
...@@ -410,11 +410,15 @@ neverallow { ...@@ -410,11 +410,15 @@ neverallow {
-ueventd -ueventd
} misc_block_device:blk_file { append link relabelfrom rename write open read ioctl lock }; } misc_block_device:blk_file { append link relabelfrom rename write open read ioctl lock };
# Only servicemanager/hwservicemanager should be able to register with binder as the context manager # Only (hw|vnd|)servicemanager should be able to register with binder as the context manager
neverallow { domain -servicemanager -hwservicemanager} *:binder set_context_mgr; neverallow { domain -servicemanager -hwservicemanager -vndservicemanager } *:binder set_context_mgr;
# The service managers are only allowed to access their own device node # The service managers are only allowed to access their own device node
neverallow servicemanager hwbinder_device:chr_file no_rw_file_perms; neverallow servicemanager hwbinder_device:chr_file no_rw_file_perms;
neverallow servicemanager vndbinder_device:chr_file no_rw_file_perms;
neverallow hwservicemanager binder_device:chr_file no_rw_file_perms; neverallow hwservicemanager binder_device:chr_file no_rw_file_perms;
neverallow hwservicemanager vndbinder_device:chr_file no_rw_file_perms;
neverallow vndservicemanager binder_device:chr_file no_rw_file_perms;
neverallow vndservicemanager hwbinder_device:chr_file no_rw_file_perms;
# Only authorized processes should be writing to files in /data/dalvik-cache # Only authorized processes should be writing to files in /data/dalvik-cache
neverallow { neverallow {
......
...@@ -293,6 +293,20 @@ get_prop($1, vold_prop) ...@@ -293,6 +293,20 @@ get_prop($1, vold_prop)
# all domains in domain.te. # all domains in domain.te.
') ')
#####################################
# vndbinder_use(domain)
# Allow domain to use Binder IPC.
define(`vndbinder_use', `
# Talk to the vndbinder device node
allow $1 vndbinder_device:chr_file rw_file_perms;
# Call the vndservicemanager and transfer references to it.
allow $1 vndservicemanager:binder { call transfer };
# vndservicemanager performs getpidcon on clients.
allow vndservicemanager $1:dir search;
allow vndservicemanager $1:file { read open };
allow vndservicemanager $1:process getattr;
')
##################################### #####################################
# binder_call(clientdomain, serverdomain) # binder_call(clientdomain, serverdomain)
# Allow clientdomain to perform binder IPC to serverdomain. # Allow clientdomain to perform binder IPC to serverdomain.
......
# vndservicemanager - the Binder context manager for vendor processes
type vndservicemanager, domain;
...@@ -28,4 +28,5 @@ ...@@ -28,4 +28,5 @@
/(vendor|system/vendor)/bin/hw/android\.hardware\.vibrator@1\.0-service u:object_r:hal_vibrator_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.vibrator@1\.0-service u:object_r:hal_vibrator_default_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.vr@1\.0-service u:object_r:hal_vr_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.vr@1\.0-service u:object_r:hal_vr_default_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.wifi@1\.0-service u:object_r:hal_wifi_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.wifi@1\.0-service u:object_r:hal_wifi_default_exec:s0
/(vendor|system/vendor)/bin/hw/wpa_supplicant u:object_r:hal_wifi_supplicant_default_exec:s0 /(vendor|system/vendor)/bin/hw/wpa_supplicant u:object_r:hal_wifi_supplicant_default_exec:s0
/(vendor|system/vendor)/bin/vndservicemanager u:object_r:vndservicemanager_exec:s0
# vndservicemanager - the Binder context manager for vendor processes
type vndservicemanager_exec, exec_type, file_type;
init_daemon_domain(vndservicemanager);
allow vndservicemanager self:binder set_context_mgr;
# transfer binder objects to other processes (TODO b/35870313 limit this to vendor-only)
allow vndservicemanager { domain -init }:binder transfer;
allow vndservicemanager vndbinder_device:chr_file rw_file_perms;
# Check SELinux permissions.
selinux_check_access(vndservicemanager)
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