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.
|
2014-09-08 22:06:40 +02:00
|
|
|
type adbd, domain, mlstrustedsubject;
|
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;
|
|
|
|
|
2015-04-24 04:42:25 +02:00
|
|
|
# Set service.adb.*, sys.powerctl, and sys.usb.ffs.ready properties.
|
2015-05-05 03:22:45 +02:00
|
|
|
set_prop(adbd, shell_prop)
|
|
|
|
set_prop(adbd, powerctl_prop)
|
|
|
|
set_prop(adbd, ffs_prop)
|
2014-01-02 21:46:39 +01:00
|
|
|
|
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;
|
|
|
|
|
2014-10-21 06:56:02 +02:00
|
|
|
userdebug_or_eng(`
|
|
|
|
# Write debugging information to /data/adb
|
|
|
|
# when persist.adb.trace_mask is set
|
|
|
|
# https://code.google.com/p/android/issues/detail?id=72895
|
|
|
|
allow adbd adb_data_file:dir rw_dir_perms;
|
|
|
|
allow adbd adb_data_file:file create_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;
|
|
|
|
|
2014-10-22 07:39:42 +02:00
|
|
|
# b/18078338 - allow read access to executable types on /system
|
|
|
|
# to assist with debugging OTA issues.
|
|
|
|
allow adbd exec_type:file r_file_perms;
|
|
|
|
|
2013-10-29 19:42:39 +01:00
|
|
|
# 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-17 23:18:56 +02:00
|
|
|
|
2014-09-09 20:38:42 +02:00
|
|
|
allow adbd kernel:security read_policy;
|
|
|
|
|
2014-12-12 01:01:27 +01:00
|
|
|
allow adbd surfaceflinger_service:service_manager find;
|
2014-12-05 06:40:22 +01:00
|
|
|
allow adbd bootchart_data_file:dir search;
|
|
|
|
allow adbd bootchart_data_file:file r_file_perms;
|
2015-04-03 01:14:40 +02:00
|
|
|
|
|
|
|
# Allow access to external storage; we have several visible mount points under /storage
|
|
|
|
# and symlinks to primary storage at places like /storage/sdcard0 and /mnt/user/0/primary
|
|
|
|
allow adbd storage_file:dir r_dir_perms;
|
|
|
|
allow adbd storage_file:lnk_file r_file_perms;
|
2015-04-03 18:52:02 +02:00
|
|
|
allow adbd mnt_user_file:dir r_dir_perms;
|
2015-04-03 01:14:40 +02:00
|
|
|
allow adbd mnt_user_file:lnk_file r_file_perms;
|