blob: 1492cbd425547b70ce6e741cc78025e5d41fe349 [file] [log] [blame]
Stephen Smalley704744a2014-09-03 11:07:03 -04001# goldfish-setup service: runs init.goldfish.sh script
Jeff Vander Stoepec488e12017-05-15 13:25:06 -07002type goldfish_setup, domain;
bohucb0bebb2017-05-26 10:26:15 -07003type goldfish_setup_exec, vendor_file_type, exec_type, file_type;
Stephen Smalley704744a2014-09-03 11:07:03 -04004
5init_daemon_domain(goldfish_setup)
6
bohu7b46d572017-12-04 12:57:10 -08007set_prop(goldfish_setup, debug_prop);
Stephen Smalley704744a2014-09-03 11:07:03 -04008allow goldfish_setup self:capability { net_admin net_raw };
bohucb0bebb2017-05-26 10:26:15 -07009allow goldfish_setup self:udp_socket { create ioctl };
10allow goldfish_setup vendor_toolbox_exec:file execute_no_trans;
Richard Haines8a09cc22016-10-20 15:47:44 +010011allowxperm goldfish_setup self:udp_socket ioctl priv_sock_ioctls;
bohucb0bebb2017-05-26 10:26:15 -070012wakelock_use(goldfish_setup);
13allow goldfish_setup vendor_shell_exec:file { rx_file_perms };
Bjoern Johansson127395f2017-02-09 22:28:47 -080014
15# Set system properties to start services
16set_prop(goldfish_setup, ctl_default_prop);
17
18# Set up WiFi
Bjoern Johansson760871c2017-08-31 12:57:18 -070019allow goldfish_setup self:netlink_route_socket { create nlmsg_write setopt bind getattr read write nlmsg_read };
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070020allow goldfish_setup self:netlink_generic_socket create_socket_perms_no_ioctl;
Bjoern Johansson127395f2017-02-09 22:28:47 -080021allow goldfish_setup self:capability { sys_module sys_admin };
Bjoern Johansson12fd2d82017-05-04 10:51:02 -070022allow goldfish_setup varrun_file:dir { mounton open read write add_name search remove_name };
Bjoern Johansson127395f2017-02-09 22:28:47 -080023allow goldfish_setup varrun_file:file { mounton getattr create read write open unlink };
24allow goldfish_setup execns_exec:file rx_file_perms;
Bjoern Johansson760871c2017-08-31 12:57:18 -070025allow goldfish_setup proc_net:file rw_file_perms;
26allow goldfish_setup proc:file r_file_perms;
27set_prop(goldfish_setup, ctl_default_prop);
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070028allow goldfish_setup nsfs:file r_file_perms;
Bjoern Johansson760871c2017-08-31 12:57:18 -070029allow goldfish_setup system_data_file:dir getattr;
30allow goldfish_setup kernel:system module_request;
31# Allow goldfish_setup to run /system/bin/ip and /system/bin/iw
32allow goldfish_setup system_file:file execute_no_trans;
33# Allow goldfish_setup to run init.wifi.sh
34allow goldfish_setup goldfish_setup_exec:file execute_no_trans;
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070035#Allow goldfish_setup to run createns in its own domain
36domain_auto_trans(goldfish_setup, createns_exec, createns);
Bjoern Johansson760871c2017-08-31 12:57:18 -070037# iw
38allow goldfish_setup sysfs:file { read open };
39# iptables
40allow goldfish_setup system_file:file lock;
41allow goldfish_setup self:rawip_socket { create getopt setopt };
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070042# Allow goldfish_setup to read createns proc file to get the namespace file
43allow goldfish_setup createns:file { read };
44allow goldfish_setup createns:dir { search };
45allow goldfish_setup createns:lnk_file { read };