2012-01-04 09:33:27 -08:00
|
|
|
# adbd seclabel is specified in init.rc since
|
|
|
|
# it lives in the rootfs and has no unique file type.
|
2013-05-17 17:11:29 -07:00
|
|
|
type adbd, domain;
|
2014-01-11 00:25:01 -08:00
|
|
|
|
|
|
|
userdebug_or_eng(`
|
2014-05-23 08:26:19 -07:00
|
|
|
allow adbd self:process setcurrent;
|
2014-01-18 18:07:06 -08:00
|
|
|
allow adbd su:process dyntransition;
|
2014-01-11 00:25:01 -08:00
|
|
|
')
|
|
|
|
|
2012-03-07 11:59:01 -08:00
|
|
|
domain_auto_trans(adbd, shell_exec, shell)
|
2013-09-30 10:54:09 -07:00
|
|
|
|
2014-01-02 12:46:39 -08: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 };
|
|
|
|
|
2014-01-11 14:11:45 -08:00
|
|
|
# Drop capabilities from bounding set on user builds.
|
|
|
|
allow adbd self:capability setpcap;
|
|
|
|
|
2014-01-02 12:46:39 -08:00
|
|
|
# Create and use network sockets.
|
|
|
|
net_domain(adbd)
|
|
|
|
|
2014-04-15 14:53:05 -07:00
|
|
|
# Access /dev/android_adb or /dev/usb-ffs/adb/ep0
|
2014-01-02 12:46:39 -08:00
|
|
|
allow adbd adb_device:chr_file rw_file_perms;
|
2014-04-15 14:53:05 -07:00
|
|
|
allow adbd functionfs:dir search;
|
|
|
|
allow adbd functionfs:file rw_file_perms;
|
2014-01-02 12:46:39 -08:00
|
|
|
|
|
|
|
# Use a pseudo tty.
|
|
|
|
allow adbd devpts:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# adb push/pull /data/local/tmp.
|
2014-06-08 13:47:33 -07:00
|
|
|
allow adbd shell_data_file:dir create_dir_perms;
|
2014-01-02 12:46:39 -08:00
|
|
|
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;
|
|
|
|
|
2014-06-05 13:27:44 -07:00
|
|
|
# adb pull /data/anr/traces.txt
|
|
|
|
allow adbd anr_data_file:dir r_dir_perms;
|
|
|
|
allow adbd anr_data_file:file r_file_perms;
|
|
|
|
|
2014-01-02 12:46:39 -08:00
|
|
|
# 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;
|
|
|
|
|
2014-02-05 14:06:26 -08:00
|
|
|
# Run /system/bin/bu
|
2014-01-02 12:46:39 -08:00
|
|
|
allow adbd system_file:file rx_file_perms;
|
|
|
|
|
|
|
|
# Perform binder IPC to surfaceflinger (screencap)
|
|
|
|
# XXX Run screencap in a separate domain?
|
|
|
|
binder_use(adbd)
|
|
|
|
binder_call(adbd, surfaceflinger)
|
2014-03-12 10:27:02 -07:00
|
|
|
# b/13188914
|
|
|
|
allow adbd gpu_device:chr_file rw_file_perms;
|
2014-01-02 12:46:39 -08:00
|
|
|
|
2013-09-30 10:54:09 -07:00
|
|
|
# Read /data/misc/adb/adb_keys.
|
|
|
|
allow adbd adb_keys_file:dir search;
|
|
|
|
allow adbd adb_keys_file:file r_file_perms;
|
|
|
|
|
2013-10-29 11:42:39 -07: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;
|