2012-01-04 18:33:27 +01:00
|
|
|
# adbd seclabel is specified in init.rc since
|
|
|
|
# it lives in the rootfs and has no unique file type.
|
2013-05-18 02:11:29 +02:00
|
|
|
type adbd, domain;
|
2014-01-02 21:46:39 +01:00
|
|
|
permissive adbd;
|
2012-03-07 20:59:01 +01:00
|
|
|
domain_auto_trans(adbd, shell_exec, shell)
|
2013-05-18 02:11:29 +02:00
|
|
|
# this is an entrypoint
|
|
|
|
allow adbd rootfs:file entrypoint;
|
2013-09-30 19:54:09 +02:00
|
|
|
|
2014-01-02 21:46:39 +01:00
|
|
|
# Do not sanitize the environment or open fds of the shell.
|
|
|
|
allow adbd shell:process noatsecure;
|
|
|
|
|
|
|
|
# Set UID and GID to shell. Set supplementary groups.
|
|
|
|
allow adbd self:capability { setuid setgid };
|
|
|
|
|
|
|
|
# Create and use network sockets.
|
|
|
|
net_domain(adbd)
|
|
|
|
|
|
|
|
# Access /dev/android_adb.
|
|
|
|
allow adbd adb_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# On emulator, access /dev/qemu*.
|
|
|
|
allow adbd qemu_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Use a pseudo tty.
|
|
|
|
allow adbd devpts:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# adb push/pull /data/local/tmp.
|
|
|
|
allow adbd shell_data_file:dir rw_dir_perms;
|
|
|
|
allow adbd shell_data_file:file create_file_perms;
|
|
|
|
|
|
|
|
# adb push/pull sdcard.
|
|
|
|
allow adbd sdcard_type:dir create_dir_perms;
|
|
|
|
allow adbd sdcard_type:file create_file_perms;
|
|
|
|
|
|
|
|
# Set service.adb.*, sys.powerctl properties.
|
|
|
|
unix_socket_connect(adbd, property, init)
|
|
|
|
allow adbd shell_prop:property_service set;
|
|
|
|
allow adbd powerctl_prop:property_service set;
|
|
|
|
|
|
|
|
# XXX Run /system/bin/vdc to connect to vold. Run in a separate domain?
|
|
|
|
# Also covers running /system/bin/bu.
|
|
|
|
allow adbd system_file:file rx_file_perms;
|
|
|
|
unix_socket_connect(adbd, vold, vold)
|
|
|
|
|
|
|
|
# Perform binder IPC to surfaceflinger (screencap)
|
|
|
|
# XXX Run screencap in a separate domain?
|
|
|
|
binder_use(adbd)
|
|
|
|
binder_call(adbd, surfaceflinger)
|
|
|
|
|
2013-09-30 19:54:09 +02:00
|
|
|
# Read /data/misc/adb/adb_keys.
|
|
|
|
allow adbd adb_keys_file:dir search;
|
|
|
|
allow adbd adb_keys_file:file r_file_perms;
|
|
|
|
|
|
|
|
# Allow access in case /data/misc/adb still has the old type.
|
|
|
|
allow adbd system_data_file:dir search;
|
|
|
|
allow adbd system_data_file:file r_file_perms;
|
2013-10-29 19:42:39 +01:00
|
|
|
|
|
|
|
# ndk-gdb invokes adb forward to forward the gdbserver socket.
|
|
|
|
allow adbd app_data_file:dir search;
|
|
|
|
allow adbd app_data_file:sock_file write;
|
|
|
|
allow adbd appdomain:unix_stream_socket connectto;
|
|
|
|
|
|
|
|
# ndk-gdb invokes adb pull of app_process, linker, and libc.so.
|
|
|
|
allow adbd zygote_exec:file r_file_perms;
|
|
|
|
allow adbd system_file:file r_file_perms;
|