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 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 # smlog_dump 12 allow hal_dumpstate_impl smlog_dump_exec:file rx_file_perms; 13 userdebug_or_eng(` 14 allow hal_dumpstate_impl smlog_dump_file:dir create_dir_perms; 15 allow hal_dumpstate_impl smlog_dump_file:file create_file_perms; 16 allow hal_dumpstate_impl netmgr_data_file:dir r_dir_perms; 17 allow hal_dumpstate_impl netmgr_data_file:file r_file_perms; 18 # TODO(b/36654253): Remove data_between_core_and_vendor_violators once 19 # dumpstate HAL no longer directly accesses /data owned by the radio app. 20 typeattribute hal_dumpstate_impl data_between_core_and_vendor_violators; 21 allow hal_dumpstate_impl radio_data_file:dir r_dir_perms; 22 allow hal_dumpstate_impl radio_data_file:file r_file_perms; 23 ') 24 25 allow hal_dumpstate_impl uio_device:chr_file rw_file_perms; 26 r_dir_file(hal_dumpstate_impl, sysfs_uio) 27 r_dir_file(hal_dumpstate_impl, sysfs_rmtfs) 28 r_dir_file(hal_dumpstate_impl, sysfs_msm_subsys) 29 30 # Access to files for dumping 31 allow hal_dumpstate_impl sysfs:dir r_dir_perms; 32 # rpm stat 33 allow hal_dumpstate_impl debugfs_rpm:file r_file_perms; 34 allow hal_dumpstate_impl debugfs_bufinfo:file r_file_perms; 35 # wlan power stats 36 allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms; 37 allow hal_dumpstate_impl debugfs_wlan:file r_file_perms; 38 # runtime-pm 39 allow hal_dumpstate_impl debugfs_runtime_pm:file r_file_perms; 40 # cnss 41 allow hal_dumpstate_impl debugfs_cnss:file r_file_perms; 42 # qsee_logger 43 allow hal_dumpstate_impl qsee_logger_exec:file rx_file_perms; 44 allow hal_dumpstate_impl debugfs_qsee_log:file r_file_perms; 45 # MDP logs 46 allow hal_dumpstate_impl debugfs_mdp:file r_file_perms; 47 # ION HEAPS 48 r_dir_file(hal_dumpstate_impl, debugfs_ion) 49 # ipc 50 r_dir_file(hal_dumpstate_impl, debugfs_ipc) 51 # Temperatures 52 r_dir_file(hal_dumpstate_impl, sysfs_thermal) 53 # CPU stat 54 r_dir_file(hal_dumpstate_impl, sysfs_devices_system_cpu) 55 # usb logs 56 userdebug_or_eng(`allow hal_dumpstate_impl debugfs_usb:file r_file_perms;') 57 58 # Access to UFS info 59 allow hal_dumpstate_impl sysfs_scsi_devices_0000:dir r_dir_perms; 60 allow hal_dumpstate_impl sysfs_scsi_devices_0000:file r_file_perms; 61 allow hal_dumpstate_impl debugfs_ufs:dir r_dir_perms; 62 allow hal_dumpstate_impl debugfs_ufs:file r_file_perms; 63 64 # For collecting bugreports. 65 allow hal_dumpstate_impl shell_data_file:file getattr; 66 67 # Query and dump power supply nodes 68 allow hal_dumpstate_impl sysfs_batteryinfo:dir search; 69 allow hal_dumpstate_impl sysfs_batteryinfo:file r_file_perms; 70 71 # Dump QCOM FG content 72 allow hal_dumpstate_impl debugfs_fg_sram:dir search; 73 allow hal_dumpstate_impl debugfs_fg_sram:file rw_file_perms; 74