1type ims, domain, domain_deprecated; 2type ims_exec, exec_type, file_type; 3 4# Started by init 5init_daemon_domain(ims) 6 7# Uses network sockets 8net_domain(ims) 9 10# Grant access to Qualcomm MSM Interface (QMI) radio sockets to ims daemon 11qmux_socket(ims) 12 13# Allow ims to communicate with netd. 14allow ims netd_socket:sock_file write; 15 16# Allow ims to communicate with cnd. 17allow ims cnd_socket:sock_file write; 18 19# Allow ims to communicate with cnd. 20allow ims cnd:unix_stream_socket connectto; 21 22# Needed to let ims daemon drop unneeded capabilities and to allow access to 23# net_bind 24allow ims self:capability { setpcap setuid net_bind_service }; 25 26# Allow ims to create and use netlink sockets. 27allow ims self:netlink_socket create_socket_perms; 28 29# Allow access to smem log 30allow ims shared_log_device:chr_file rw_file_perms; 31 32# ims needs to parse through /proc to obtain pid of netmgrd 33r_dir_file(ims, netmgrd) 34 35# b/18352920 suppress denials until the procfs lookup is removed 36dontaudit ims domain:dir r_dir_perms; 37 38# Allow ims to create and use socket to communicate between ims processes. 39allow ims self:socket create_socket_perms; 40 41# Runs /system/bin/sh for executing ndc commands via popen 42allow ims shell_exec:file rx_file_perms; 43 44# Runs /system/bin/ndc 45allow ims system_file:file rx_file_perms; 46 47# XXX Run toolbox. Might not be needed. 48allow ims toolbox_exec:file rx_file_perms; 49auditallow ims toolbox_exec:file rx_file_perms; 50 51# Allow ims to tell init to start the ims data service via property=sys.ims.QMI_DAEMON_STATUS 52set_prop(ims, qcom_ims_prop) 53allow ims qcom_ims_prop:property_service set; 54allow ims ims_socket:sock_file write; 55 56allow ims wpa_socket:sock_file create_file_perms; 57allow ims wpa_socket:dir rw_dir_perms; 58 59allow ims wifi_data_file:dir r_dir_perms; 60 61unix_socket_send(ims, wpa, wpa) 62