f95636651c
adbd was only in enforcing for user builds. Commit Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6 allows us to move it into enforcing for everyone. Do it. Change-Id: Ie1a3e5361c891d2c9366e11f35699e3146cc3d88
72 lines
2.2 KiB
Text
72 lines
2.2 KiB
Text
# adbd seclabel is specified in init.rc since
|
|
# it lives in the rootfs and has no unique file type.
|
|
type adbd, domain;
|
|
|
|
userdebug_or_eng(`
|
|
allow adbd su:process dyntransition;
|
|
')
|
|
|
|
domain_auto_trans(adbd, shell_exec, shell)
|
|
# this is an entrypoint
|
|
allow adbd rootfs:file entrypoint;
|
|
|
|
# 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 };
|
|
|
|
# Drop capabilities from bounding set on user builds.
|
|
allow adbd self:capability setpcap;
|
|
|
|
# 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)
|
|
|
|
# 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;
|
|
|
|
# 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;
|