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-11 09:25:01 +01:00
|
|
|
|
|
|
|
userdebug_or_eng(`
|
2014-05-23 17:26:19 +02:00
|
|
|
allow adbd self:process setcurrent;
|
2014-01-19 03:07:06 +01:00
|
|
|
allow adbd su:process dyntransition;
|
2014-01-11 09:25:01 +01:00
|
|
|
')
|
|
|
|
|
2012-03-07 20:59:01 +01:00
|
|
|
domain_auto_trans(adbd, shell_exec, shell)
|
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 };
|
|
|
|
|
2014-01-11 23:11:45 +01:00
|
|
|
# Drop capabilities from bounding set on user builds.
|
|
|
|
allow adbd self:capability setpcap;
|
|
|
|
|
2014-01-02 21:46:39 +01:00
|
|
|
# Create and use network sockets.
|
|
|
|
net_domain(adbd)
|
|
|
|
|
2014-04-15 23:53:05 +02:00
|
|
|
# Access /dev/android_adb or /dev/usb-ffs/adb/ep0
|
2014-01-02 21:46:39 +01:00
|
|
|
allow adbd adb_device:chr_file rw_file_perms;
|
2014-04-15 23:53:05 +02:00
|
|
|
allow adbd functionfs:dir search;
|
|
|
|
allow adbd functionfs:file rw_file_perms;
|
2014-01-02 21:46:39 +01:00
|
|
|
|
|
|
|
# Use a pseudo tty.
|
|
|
|
allow adbd devpts:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# adb push/pull /data/local/tmp.
|
2014-06-08 22:47:33 +02:00
|
|
|
allow adbd shell_data_file:dir create_dir_perms;
|
2014-01-02 21:46:39 +01: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 22:27:44 +02: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 21:46:39 +01: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 23:06:26 +01:00
|
|
|
# Run /system/bin/bu
|
2014-01-02 21:46:39 +01: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 18:27:02 +01:00
|
|
|
# b/13188914
|
|
|
|
allow adbd gpu_device:chr_file rw_file_perms;
|
2014-01-02 21:46:39 +01:00
|
|
|
|
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;
|
|
|
|
|
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;
|
2014-07-26 00:19:47 +02:00
|
|
|
|
|
|
|
service_manager_local_audit_domain(adbd)
|
|
|
|
auditallow adbd {
|
|
|
|
service_manager_type
|
|
|
|
-surfaceflinger_service
|
|
|
|
}:service_manager find;
|