blob: 2ebf9d812b81cad02bec37b0ca004c6c76ce3aeb [file] [log] [blame]
Inseob Kimff43be22021-06-07 16:56:56 +09001typeattribute adbd coredomain;
2typeattribute adbd mlstrustedsubject;
3
4init_daemon_domain(adbd)
5
6domain_auto_trans(adbd, shell_exec, shell)
7
8userdebug_or_eng(`
9 allow adbd self:process setcurrent;
10 allow adbd su:process dyntransition;
11')
12
Inseob Kimff43be22021-06-07 16:56:56 +090013# Do not sanitize the environment or open fds of the shell. Allow signaling
14# created processes.
15allow adbd shell:process { noatsecure signal };
16
17# Set UID and GID to shell. Set supplementary groups.
18allow adbd self:global_capability_class_set { setuid setgid };
19
20# Drop capabilities from bounding set on user builds.
21allow adbd self:global_capability_class_set setpcap;
22
Inseob Kimff43be22021-06-07 16:56:56 +090023# adbd probes for vsock support. Do not generate denials when
24# this occurs. (b/123569840)
25dontaudit adbd self:{ socket vsock_socket } create;
26
27# Allow adbd inside vm to forward vm's vsock.
28allow adbd self:vsock_socket { create_socket_perms_no_ioctl listen accept };
29
Inseob Kimff43be22021-06-07 16:56:56 +090030# Use a pseudo tty.
31allow adbd devpts:chr_file rw_file_perms;
32
33# adb push/pull /data/local/tmp.
34allow adbd shell_data_file:dir create_dir_perms;
35allow adbd shell_data_file:file create_file_perms;
36
Inseob Kimff43be22021-06-07 16:56:56 +090037allow adbd tmpfs:dir search;
Inseob Kimff43be22021-06-07 16:56:56 +090038
39allow adbd rootfs:dir r_dir_perms;
40
Inseob Kimff43be22021-06-07 16:56:56 +090041# Connect to shell and use a socket transferred from it.
42# Used for e.g. abb.
43allow adbd shell:unix_stream_socket { read write shutdown };
44allow adbd shell:fd use;