1 type hal_dumpstate_impl, domain; 2 hal_server_domain(hal_dumpstate_impl, hal_dumpstate) 3 4 type hal_dumpstate_impl_exec, exec_type, vendor_file_type, file_type; 5 init_daemon_domain(hal_dumpstate_impl) 6 7 # Execute dump scripts from vendor partition 8 allow hal_dumpstate_impl vendor_shell_exec:file rx_file_perms; 9 allow hal_dumpstate_impl vendor_toolbox_exec:file rx_file_perms; 10 11 # Allow to read pixel-trace trace file 12 allow hal_dumpstate_impl debugfs_tracing_instances:dir search; 13 allow hal_dumpstate_impl debugfs_tracing_instances:file r_file_perms; 14 15 userdebug_or_eng(` 16 # smlog_dump 17 domain_auto_trans(hal_dumpstate_impl, smlog_dump_exec, smlog_dump) 18 allow hal_dumpstate_impl modem_dump_file:dir create_dir_perms; 19 allow hal_dumpstate_impl modem_dump_file:file create_file_perms; 20 allow hal_dumpstate_impl radio_vendor_data_file:dir r_dir_perms; 21 allow hal_dumpstate_impl radio_vendor_data_file:file r_file_perms; 22 allow hal_dumpstate_impl netmgr_data_file:dir r_dir_perms; 23 allow hal_dumpstate_impl netmgr_data_file:file r_file_perms; 24 allow hal_dumpstate_impl sysfs_usb_device:dir r_dir_perms; 25 allow hal_dumpstate_impl sysfs_usb_device:file r_file_perms; 26 allow hal_dumpstate_impl ssr_log_file:dir search; 27 allow hal_dumpstate_impl ssr_log_file:file r_file_perms; 28 allow hal_dumpstate_impl tcpdump_vendor_data_file:dir create_dir_perms; 29 allow hal_dumpstate_impl tcpdump_vendor_data_file:file create_file_perms; 30 31 set_prop(hal_dumpstate_impl, vendor_modem_diag_prop) 32 set_prop(hal_dumpstate_impl, vendor_tcpdump_log_prop) 33 34 #Dump perfstatsd 35 allow hal_dumpstate_impl perfstatsd_exec:file rx_file_perms; 36 allow hal_dumpstate_impl perfstatsd_service:service_manager find; 37 vndbinder_use(hal_dumpstate_impl) 38 binder_call(hal_dumpstate_impl, perfstatsd) 39 ') 40 41 # modem stat 42 domain_auto_trans(hal_dumpstate_impl, modem_svc_exec, modem_svc) 43 allow hal_dumpstate_impl modem_stat_data_file:file r_file_perms; 44 45 dontaudit hal_dumpstate_impl modem_dump_file:dir create_dir_perms; 46 dontaudit hal_dumpstate_impl modem_dump_file:file create_file_perms; 47 48 allow hal_dumpstate_impl uio_device:chr_file rw_file_perms; 49 r_dir_file(hal_dumpstate_impl, sysfs_uio) 50 r_dir_file(hal_dumpstate_impl, sysfs_rmtfs) 51 r_dir_file(hal_dumpstate_impl, sysfs_msm_subsys) 52 r_dir_file(hal_dumpstate_impl, sysfs_soc) 53 r_dir_file(hal_dumpstate_impl, sysfs_thermal) 54 r_dir_file(hal_dumpstate_impl, sysfs_easel) 55 56 allow hal_dumpstate_impl sysfs_rpm:file r_file_perms; 57 allow hal_dumpstate_impl sysfs_system_sleep_stats:file r_file_perms; 58 59 allow hal_dumpstate_impl debugfs_ion:dir r_dir_perms; 60 allow hal_dumpstate_impl debugfs_ion:file r_file_perms; 61 allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms; 62 allow hal_dumpstate_impl debugfs_wlan:file r_file_perms; 63 allow hal_dumpstate_impl debugfs_icnss:dir r_dir_perms; 64 allow hal_dumpstate_impl debugfs_icnss:file r_file_perms; 65 allow hal_dumpstate_impl debugfs_ipc:dir r_dir_perms; 66 allow hal_dumpstate_impl debugfs_ipc:file r_file_perms; 67 allow hal_dumpstate_impl debugfs_f2fs:dir r_dir_perms; 68 allow hal_dumpstate_impl debugfs_f2fs:file r_file_perms; 69 allow hal_dumpstate_impl debugfs_tzdbg:dir search; 70 allow hal_dumpstate_impl debugfs_tzdbg:file r_file_perms; 71 allow hal_dumpstate_impl debugfs_ufs:dir r_dir_perms; 72 allow hal_dumpstate_impl debugfs_ufs:file r_file_perms; 73 allow hal_dumpstate_impl debugfs_mmc:dir r_dir_perms; 74 allow hal_dumpstate_impl debugfs_mmc:file r_file_perms; 75 allow hal_dumpstate_impl sysfs_esim:file r_file_perms; 76 allow hal_dumpstate_impl sysfs_mmc:dir r_dir_perms; 77 allow hal_dumpstate_impl sysfs_mmc:file r_file_perms; 78 allow hal_dumpstate_impl proc_stat:file r_file_perms; 79 allow hal_dumpstate_impl proc_f2fs:dir r_dir_perms; 80 allow hal_dumpstate_impl proc_f2fs:file r_file_perms; 81 82 # Access to files for dumping 83 allow hal_dumpstate_impl sysfs:dir r_dir_perms; 84 # usb logs 85 allow hal_dumpstate_impl debugfs_usb:file r_file_perms; 86 87 #Access display debug data 88 allow hal_dumpstate_impl display_vendor_data_file:dir r_dir_perms; 89 allow hal_dumpstate_impl display_vendor_data_file:file r_file_perms; 90 91 # Access to touch firmware info 92 allow hal_dumpstate_impl sysfs_touch:dir r_dir_perms; 93 allow hal_dumpstate_impl sysfs_touch:file rw_file_perms; 94 95 # Access to touch proc node 96 allow hal_dumpstate_impl proc_touch:file rw_file_perms; 97 98 # Access to WLC firmware info 99 allow hal_dumpstate_impl sysfs_wlc:dir r_dir_perms; 100 allow hal_dumpstate_impl sysfs_wlc:file r_file_perms; 101 102 # Access to UFS info 103 allow hal_dumpstate_impl sysfs_scsi_devices_0000:dir r_dir_perms; 104 allow hal_dumpstate_impl sysfs_scsi_devices_0000:file r_file_perms; 105 106 # Access to MPSS RFS info 107 userdebug_or_eng(` 108 allow hal_dumpstate_impl mpss_rfs_data_file:dir r_dir_perms; 109 allow hal_dumpstate_impl mpss_rfs_data_file:file r_file_perms; 110 ') 111 112 # For collecting bugreports. 113 allow hal_dumpstate_impl shell_data_file:file getattr; 114 allow hal_dumpstate_impl sysfs_system_sleep_stats:file r_file_perms; 115 # For '/vendor/bin/sh -c getprop | grep vendor.sys.modem.diag' 116 allow hal_dumpstate_impl vendor_file:file execute_no_trans; 117 userdebug_or_eng(`allow hal_dumpstate_impl debugfs_dma_bufinfo:file r_file_perms;') 118 dontaudit hal_dumpstate_impl debugfs_dma_bufinfo:file r_file_perms; 119 120 # Query and dump power supply nodes 121 allow hal_dumpstate_impl sysfs_batteryinfo:dir search; 122 allow hal_dumpstate_impl sysfs_batteryinfo:file r_file_perms; 123 124 # Dump QCOM FG content 125 allow hal_dumpstate_impl debugfs_fg_sram:dir search; 126 allow hal_dumpstate_impl debugfs_fg_sram:file rw_file_perms; 127 128 # Dump Maxim FG content 129 allow hal_dumpstate_impl debugfs_maxfg:dir search; 130 allow hal_dumpstate_impl debugfs_maxfg:file r_file_perms; 131 132 # Dump PMIC data 133 allow hal_dumpstate_impl debugfs_pmic:dir r_dir_perms; 134 allow hal_dumpstate_impl debugfs_pmic:file r_file_perms; 135 136 allow hal_dumpstate_impl dumpstate:fifo_file write; 137 138 dontaudit hal_dumpstate_impl binder_device:chr_file rw_file_perms; 139 dontaudit hal_dumpstate_impl vndbinder_device:chr_file rw_file_perms; 140 dontaudit hal_dumpstate_impl property_socket:sock_file rw_file_perms; 141 dontaudit hal_dumpstate_impl radio_vendor_data_file:dir r_dir_perms; 142 dontaudit hal_dumpstate_impl radio_vendor_data_file:file r_file_perms; 143 dontaudit hal_dumpstate_impl netmgr_data_file:dir r_dir_perms; 144 dontaudit hal_dumpstate_impl netmgr_data_file:file r_file_perms; 145 dontaudit hal_dumpstate_impl vendor_modem_diag_prop:file rw_file_perms; 146 dontaudit hal_dumpstate_impl vendor_tcpdump_log_prop:file rw_file_perms; 147 dontaudit hal_dumpstate_impl sysfs_usb_device:dir r_dir_perms; 148 dontaudit hal_dumpstate_impl sysfs_usb_device:file r_file_perms; 149 dontaudit hal_dumpstate_impl ssr_log_file:dir search; 150 dontaudit hal_dumpstate_impl ssr_log_file:file r_file_perms; 151 dontaudit hal_dumpstate_impl tcpdump_vendor_data_file:dir create_dir_perms; 152 dontaudit hal_dumpstate_impl tcpdump_vendor_data_file:file create_file_perms; 153 dontaudit hal_dumpstate_impl perfstatsd_exec:file rx_file_perms; 154 dontaudit hal_dumpstate_impl perfstatsd_service:service_manager find; 155 dontaudit hal_dumpstate_impl mpss_rfs_data_file:dir r_dir_perms; 156 dontaudit hal_dumpstate_impl mpss_rfs_data_file:file r_file_perms; 157