blob: 2d6bd05241b44022e72c9d9fea9aaef326cad226 [file] [log] [blame]
Avijit Kanti Das353e9292014-07-23 23:39:30 -07001type netmgrd, domain;
2type netmgrd_exec, exec_type, file_type;
3net_domain(netmgrd)
4init_daemon_domain(netmgrd)
Subash Abhinov Kasiviswanathan1b307e72014-03-04 11:09:42 -07005
6userdebug_or_eng(`
Shruthi Krishnaf1b38f72014-07-25 16:21:53 -07007 domain_auto_trans(shell, netmgrd_exec, netmgrd)
8 domain_auto_trans(adbd, netmgrd_exec, netmgrd)
Subash Abhinov Kasiviswanathan1b307e72014-03-04 11:09:42 -07009')
Avijit Kanti Das353e9292014-07-23 23:39:30 -070010
11#Allow files to be written during the operation of netmgrd
12file_type_auto_trans(netmgrd, system_data_file, data_test_data_file)
13
14#Allow netmgrd operations
Subash Abhinov Kasiviswanathan4e2e5af2014-10-16 13:37:05 -060015allow netmgrd netmgrd:capability { dac_override net_raw net_admin sys_module fsetid setgid setuid setpcap };
Avijit Kanti Das353e9292014-07-23 23:39:30 -070016
17#Allow access to kernel modules
18allow netmgrd kernel:system { module_request };
19
20#Allow logging
21allow netmgrd diag_device:chr_file { rw_file_perms };
22allow netmgrd smem_log_device:chr_file { rw_file_perms };
23
24#Allow operations on different types of sockets
25allow netmgrd netmgrd:rawip_socket { create getopt setopt write };
26allow netmgrd netmgrd:netlink_xfrm_socket { create bind };
27allow netmgrd netmgrd:netlink_socket { write read create bind };
28allow netmgrd netmgrd:socket { create ioctl };
29allow netmgrd netmgrd:netlink_route_socket { setopt getattr write nlmsg_write };
30allow netmgrd init:unix_stream_socket { connectto };
Avijit Kanti Dasfe61c2d2014-10-16 20:17:03 -070031allow netmgrd property_socket:sock_file write;
Avijit Kanti Das353e9292014-07-23 23:39:30 -070032
Biswajit Paul64f83f62014-10-13 14:36:16 -070033qmux_socket(netmgrd);
Avijit Kanti Das353e9292014-07-23 23:39:30 -070034
35#Allow writing of ipv6 network properties
36allow netmgrd proc_net:file { write };
37
Subash Abhinov Kasiviswanathan1b307e72014-03-04 11:09:42 -070038#Allow address configuration
39allow netmgrd system_prop:property_service { set };
40
Subash Abhinov Kasiviswanathan4e2e5af2014-10-16 13:37:05 -060041#Allow setting of DNS and GW Android properties
42allow netmgrd net_radio_prop:property_service { set };
43
Avijit Kanti Das353e9292014-07-23 23:39:30 -070044#Allow execution of commands in shell
45allow netmgrd system_file:file { execute_no_trans };
Avijit Kanti Dasf91f2ba2014-09-24 17:08:13 -070046
Biswajit Pauld8ab6262014-10-23 16:27:42 -070047allow netmgrd self:socket create_socket_perms;
Avijit Kanti Dasfe61c2d2014-10-16 20:17:03 -070048allow netmgrd sysfs_esoc:dir r_dir_perms;
Avijit Kanti Dasf91f2ba2014-09-24 17:08:13 -070049
50#Allow communication with netd
51allow netmgrd netd_socket:sock_file write;
Subash Abhinov Kasiviswanathan4e2e5af2014-10-16 13:37:05 -060052
53#Allow nemtgrd to use esoc api's to determine target
Avijit Kanti Dasfe61c2d2014-10-16 20:17:03 -070054allow netmgrd shell_exec:file { execute r_file_perms execute_no_trans };
55allow netmgrd sysfs_esoc:lnk_file read;
Avijit Kanti Dasd01b3b32014-10-21 10:30:09 -070056
57r_dir_file(netmgrd, sysfs_ssr);