Following suggestions by Stricted.
-allow adbd proc_last_kmsg:file { getattr read open };
+allow adbd proc_last_kmsg:file r_file_perms;
-allow apexd sysfs_virtual:file { read write open };
+allow apexd sysfs_virtual:file rw_file_perms;
-allow cbd factoryprop_efs_file:file { open read };
-allow cbd sysfs_info:file { open read };
+allow cbd factoryprop_efs_file:file r_file_perms;
+allow cbd sysfs_info:file r_file_perms;
allow hal_audio_default system_suspend_hwservice:hwservice_manager find;
# /efs/maxim/rdc_cal
-allow hal_audio_default efs_file:file { read open };
+allow hal_audio_default efs_file:file r_file_perms;
allow hal_audio_default efs_file:dir search;
allow hal_audio_default imei_efs_file:dir search;
-allow hal_audio_default imei_efs_file:file { getattr open read };
+allow hal_audio_default imei_efs_file:file r_file_perms;
allow hal_audio_default vendor_radio_prop:file { getattr open read };
allow hal_audio_default init:unix_stream_socket connectto;
allow hal_bluetooth_default vendor_default_prop:property_service set;
-allow hal_bluetooth_default vendor_firmware_file:dir { open read };
+allow hal_bluetooth_default vendor_firmware_file:dir r_dir_perms;
vndbinder_use(hal_camera_default)
-allow hal_camera_default vndbinder_device:chr_file { ioctl open write read };
+allow hal_camera_default vndbinder_device:chr_file r_file_perms;
allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find;
allow hal_camera_default hal_graphics_composer_default:fd use;
allow hal_camera_default sysfs_virtual:dir search;
-allow hal_camera_default sysfs_virtual:file { getattr open read write };
+allow hal_camera_default sysfs_virtual:file rw_file_perms;
allow hal_camera_default sysfs_camera:dir search;
-allow hal_camera_default sysfs_camera:file { getattr open read write };
+allow hal_camera_default sysfs_camera:file rw_file_perms;
allow hal_camera_default exported_camera_prop:file { getattr open read };
allow hal_camera_default camera_data_file:dir search;
-# add_hwservice(hal_camera_default, hal_vendor_multiframeprocessing_hwservice)
-# add_hwservice(hal_camera_default, hal_vendor_iva_hwservice)
-
binder_call(hal_camera_default, system_server)
binder_call(system_server, hal_camera_default)
allow hal_drm_widevine mediadrm_data_file:dir create_dir_perms;
allow hal_drm_widevine mediadrm_data_file:file create_file_perms;
allow hal_drm_widevine media_data_file:dir search;
-allow hal_drm_widevine vendor_data_file:dir { write create add_name } ;
-allow hal_drm_widevine vendor_data_file:file { create open read write getattr } ;
+allow hal_drm_widevine vendor_data_file:dir create_dir_perms;
+allow hal_drm_widevine vendor_data_file:file create_file_perms;
-allow hal_drm_widevine cpk_efs_file:file { open read getattr };
+allow hal_drm_widevine cpk_efs_file:file r_file_perms;
allow hal_drm_widevine efs_file:dir search;
-allow hal_drm_widevine secmem_device:chr_file { open read write ioctl };
+allow hal_drm_widevine secmem_device:chr_file rw_file_perms;
allow hal_fingerprint_default fingerprintd_data_file:dir write;
-allow hal_fingerprint_default tee_device:chr_file { ioctl open read write };
-allow hal_fingerprint_default fingerprint_device:chr_file { ioctl open read write };
+allow hal_fingerprint_default tee_device:chr_file rw_file_perms;
+allow hal_fingerprint_default fingerprint_device:chr_file rw_file_perms;
allow hal_fingerprint_default sysfs_virtual:dir search;
-allow hal_fingerprint_default sysfs_virtual:file { open read };
+allow hal_fingerprint_default sysfs_virtual:file r_file_perms;
-allow hal_gatekeeper_default gatekeeper_efs_file:file { write open read };
+allow hal_gatekeeper_default gatekeeper_efs_file:file rw_file_perms;
allow hal_gatekeeper_default gatekeeper_efs_file:dir search;
-allow hal_gatekeeper_default tee_device:chr_file { open read write };
+allow hal_gatekeeper_default tee_device:chr_file rw_file_perms;
allow hal_gatekeeper_default efs_file:dir search;
r_dir_file(hal_health_default, sysfs_charger)
allow hal_health_default sysfs_charger:file rw_file_perms;
-allow hal_health_default sysfs_battery:dir { open read search };
-allow hal_health_default sysfs_battery:file { getattr open read };
+allow hal_health_default sysfs_battery:dir r_dir_perms;
+allow hal_health_default sysfs_battery:file r_file_perms;
allow hal_health_default sysfs_battery_writable:dir search;
-allow hal_health_default sysfs_battery_writable:file { getattr open read };
+allow hal_health_default sysfs_battery_writable:file r_file_perms;
allow hal_health_default sysfs_batteryinfo_charger_writable:dir search;
-allow hal_light_default sysfs_graphics:file { getattr open read write };
+allow hal_light_default sysfs_graphics:file rw_file_perms;
allow hal_light_default sysfs_virtual:dir search;
-allow hal_light_default sysfs_virtual:file { open write getattr };
+allow hal_light_default sysfs_virtual:file rw_file_perms;
# Allow LiveDisplay to store files under /data/vendor/display and access them
allow hal_lineage_livedisplay_sysfs display_vendor_data_file:dir rw_dir_perms;
allow hal_lineage_livedisplay_sysfs display_vendor_data_file:file create_file_perms;
+
# Allow LiveDisplay to read and write to files in sysfs_graphics, sysfs_mdnie
allow hal_lineage_livedisplay_sysfs sysfs_mdnie:dir search;
allow hal_lineage_livedisplay_sysfs sysfs_mdnie:file rw_file_perms;
-allow hal_power_default sysfs_graphics:file { getattr open read };
-allow hal_power_default sysfs_input:file { getattr open read };
-allow hal_power_default sysfs_virtual:dir { open read search };
-allow hal_power_default sysfs_virtual:file { getattr open read };
-allow hal_power_default sysfs_spi_writeable:dir { open read search };
+allow hal_power_default sysfs_graphics:file r_file_perms;
+allow hal_power_default sysfs_input:file r_file_perms;
+allow hal_power_default sysfs_virtual:dir r_dir_perms;
+allow hal_power_default sysfs_virtual:file r_file_perms;
+allow hal_power_default sysfs_spi_writeable:dir r_dir_perms;
allow hal_power_default sysfs_spi_writeable:file rw_file_perms;
-allow hal_power_default sysfs_touchscreen_writable:dir { open read search };
-# allow hal_power_default sysfs_touchscreen_writeable:file rw_file_perms;
+allow hal_power_default sysfs_touchscreen_writable:dir r_dir_perms;
-allow hal_sensors_default sysfs_iio:file { getattr open read };
+allow hal_sensors_default sysfs_iio:file r_file_perms;
allow hal_sensors_default sysfs_iio:lnk_file read;
-allow hal_sensors_default sysfs_virtual:dir { open read search };
-allow hal_sensors_default sysfs_virtual:file { read write open getattr };
+allow hal_sensors_default sysfs_virtual:dir r_dir_perms;
+allow hal_sensors_default sysfs_virtual:file rw_file_perms;
allow hal_sensors_default sysfs_virtual:lnk_file read;
-allow hal_sensors_default sysfs_lcd:file { open read };
-allow hal_sensors_default baro_delta_factoryapp_efs_file:file { open read };
+allow hal_sensors_default sysfs_lcd:file r_file_perms;
+allow hal_sensors_default baro_delta_factoryapp_efs_file:file r_file_perms;
allow hal_sensors_default sysfs_input:file read;
-allow hal_sensors_default sysfs_spi_writeable:file { read open write };
+allow hal_sensors_default sysfs_spi_writeable:file rw_file_perms;
allow init rild:unix_stream_socket connectto;
-allow init self:netlink_kobject_uevent_socket { create setopt };
-allow init socket_device:sock_file { create setattr unlink };
+allow init self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
+allow init socket_device:sock_file create_file_perms;
allow init sysfs_devices_system_cpu:file write;
allow init vendor_data_file:fifo_file write;
allow init vendor_data_file:file append;
allow init efs_block_device:lnk_file relabelto;
allow init tmpfs:lnk_file create;
-allow init sysfs_virtual:file { open write setattr read };
+allow init sysfs_virtual:file create_file_perms;
allow init sysfs_virtual:lnk_file { read };
allow init sysfs:file setattr;
allow init sysfs_multipdp:file setattr;
allow init sysfs_input:file setattr;
allow init sysfs_lcd:file setattr;
allow init sysfs_mdnie:file setattr;
-allow init sysfs_modem:file { open write };
+allow init sysfs_modem:file w_file_perms;
allow init sysfs_battery_writable:file setattr;
allow init sysfs_mmc_host_writable:file setattr;
allow init sysfs_scsi_host_writable:file setattr;
allow init sysfs_power_writable:file setattr;
allow init sysfs_bt_writable:file setattr;
-allow init sysfs_graphics:file { setattr open read write };
+allow init sysfs_graphics:file create_file_perms;
allow init sysfs_touchscreen_writable:file setattr;
allow init system_server:binder { transfer call };
-allow init tee_device:chr_file { ioctl open read write };
+allow init tee_device:chr_file rw_file_perms;
allow init device:chr_file ioctl;
-allow init self:tcp_socket { getopt create bind connect };
+allow init self:tcp_socket create_socket_perms;
allow init node:tcp_socket node_bind;
allow init port:tcp_socket { name_bind name_connect };
allow init gps_vendor_data_file:fifo_file write;
allow init gps_vendor_data_file:file lock;
-allow init socket_device:sock_file { setattr unlink };
+allow init socket_device:sock_file create_file_perms;
allow init kernel:system module_request;
allow init proc:file setattr;
allow kernel efs_file:dir search;
allow kernel device:chr_file { getattr setattr unlink create };
-allow kernel device:dir { add_name remove_name rmdir write };
+allow kernel device:dir create_dir_perms;
allow kernel self:capability { mknod };
allow lhd sysfs_virtual:dir search;
-allow lhd sysfs_virtual:file { open read write };
+allow lhd sysfs_virtual:file rw_file_perms;
allow lhd sysfs_virtual:lnk_file read;
allow lhd efs_file:dir search;
# /sys/class/video4linux/video6/name
-allow mediacodec sysfs_v4l:dir { search open read };
+allow mediacodec sysfs_v4l:dir r_dir_perms;
allow mediacodec sysfs_v4l_mfc:dir search;
-allow mediacodec sysfs_v4l_mfc:file { getattr open read };
+allow mediacodec sysfs_v4l_mfc:file r_file_perms;
allow netd self:capability sys_module;
-allow netd init:tcp_socket { setopt getopt read write };
+allow netd init:tcp_socket rw_socket_perms_no_ioctl;
allow netd sysfs_virtual:dir search;
-allow netd sysfs_virtual:file { write open };
+allow netd sysfs_virtual:file w_file_perms;
# /dev/mali0
-allow platform_app gpu_device:chr_file { ioctl read write };
+allow platform_app gpu_device:chr_file rw_file_perms;
# /dev/mali0
-allow priv_app gpu_device:chr_file { ioctl read write };
+allow priv_app gpu_device:chr_file rw_file_perms;
allow priv_app debugfs_ion:dir search;
allow priv_app debugfs_mali:dir search;
allow priv_app debugfs_mali_mem:dir search;
-allow priv_app sysfs_zram:file { getattr open read };
+allow priv_app sysfs_zram:file r_file_perms;
allow rild proc_net:file write;
-allow rild vendor_data_file:file { getattr setattr read write open };
+allow rild vendor_data_file:file create_file_perms;
# /dev/umts_ipc0
allow rild radio_device:chr_file ioctl;
-allow rild bin_nv_data_efs_file:file { setattr getattr read open write };
+allow rild bin_nv_data_efs_file:file create_file_perms;
-allow rild radio_vendor_data_file:file { create ioctl lock getattr read write open unlink };
-allow rild radio_vendor_data_file:dir { add_name write open read remove_name };
-allow rild radio_data_file:file { open read getattr write };
+allow rild radio_vendor_data_file:file create_file_perms;
+allow rild radio_vendor_data_file:dir rw_dir_perms;
+allow rild radio_data_file:file rw_file_perms;
allow rild radio_data_file:dir search;
allow rild proc_qtaguid_stat:file read;
-allow rild factoryprop_efs_file:file { open read write };
+allow rild factoryprop_efs_file:file rw_file_perms;
allow rild init:file getattr;
# /dev/mali0
-allow surfaceflinger gpu_device:chr_file { ioctl read write };
+allow surfaceflinger gpu_device:chr_file rw_file_perms;
# /dev/mali0
-allow system_app gpu_device:chr_file { ioctl read write };
+allow system_app gpu_device:chr_file rw_file_perms;
-allow system_app proc_pagetypeinfo:file { getattr open read };
+allow system_app proc_pagetypeinfo:file r_file_perms;
allow system_app sysfs_virtual:dir search;
# /dev/mali0
-allow system_server gpu_device:chr_file { ioctl read write };
+allow system_server gpu_device:chr_file rw_file_perms;
# memtrack HAL
allow system_server debugfs_mali:dir r_dir_perms;
allow system_server debugfs_mali:file r_file_perms;
-allow system_server debugfs_ion:file { getattr open read };
-allow system_server debugfs_mali_mem:file { getattr open read };
+allow system_server debugfs_ion:file r_file_perms;
+allow system_server debugfs_mali_mem:file r_file_perms;
-allow system_server frp_block_device:blk_file { getattr ioctl open read write };
+allow system_server frp_block_device:blk_file rw_file_perms;
allow system_server vendor_radio_prop:file { getattr open read };
allow tee efs_file:dir { search getattr };
-allow tee efs_file:file { getattr open read };
-allow tee gatekeeper_efs_file:dir { search open read };
-allow tee gatekeeper_efs_file:file { getattr open read };
+allow tee efs_file:file r_file_perms;
+allow tee gatekeeper_efs_file:dir r_dir_perms;
+allow tee gatekeeper_efs_file:file r_file_perms;
allow tee init:unix_stream_socket connectto;
allow tee property_socket:sock_file write;
allow tee prov_efs_file:dir search;
allow tee tee_prop:property_service set;
# /dev/t-base-tui
-allow tee tee_device:chr_file { ioctl open read };
+allow tee tee_device:chr_file r_file_perms;
-allow tee mobicore_vendor_data_file:dir { search open read };
+allow tee mobicore_vendor_data_file:dir r_dir_perms;
allow tee mobicore_vendor_data_file:file rw_file_perms;
-allow toolbox ram_device:blk_file { open read write };
\ No newline at end of file
+allow toolbox ram_device:blk_file rw_file_perms;