universal7885: SamsungParts: add gpu, selinux and update related sepolicy

This commit is contained in:
roynatech2544 2021-10-25 00:04:38 +09:00
commit c1a9d9f071
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
36 changed files with 632 additions and 170 deletions

View file

@ -1,5 +0,0 @@
allow init sysfs_gpu_tmu:file { setattr };
allow init sysfs_flashlight:file { setattr };
allow init selinuxfs:file { setattr };
allow init sysfs_sec_switch_writable:file { setattr };
allow init sysfs_battery_writable:file { setattr }; repo):universal7885-common/sepolicy/public/init.te

View file

@ -1,9 +0,0 @@
allow system_app sysfs_gpu_tmu:file { read open write getattr };
allow system_app sysfs_flashlight:file { read open write getattr };
allow system_app selinuxfs:file rw_file_perms;
allow system_app sysfs_sec_switch:dir { search };
allow system_app sysfs_sec_switch_writable:file rw_file_perms;
allow system_app sysfs_battery_writeable:file rw_file_perms;
allow system_app sysfs_sec_switch_writable:dir { search };
allow system_app sysfs_battery_writeable:dir { search };
allow system_app sysfs_battery:dir { search };

View file

@ -1,123 +1,123 @@
### DATA
type biometrics_vendor_data_file, file_type, data_file_type;
type conn_vendor_data_file, file_type, data_file_type;
type gps_vendor_data_file, file_type, data_file_type;
type log_vendor_data_file, file_type, data_file_type;
type log_cbd_vendor_data_file, file_type, data_file_type;
type radio_vendor_data_file, file_type, data_file_type;
type wifi_vendor_data_file, file_type, data_file_type;
# EFS
type app_efs_file, file_type;
type battery_efs_file, file_type;
type bin_nv_data_efs_file, file_type;
type cpk_efs_file, file_type;
type imei_efs_file, file_type;
type nfc_efs_file, file_type;
type pfw_efs_file, file_type;
type prov_efs_file, file_type;
type sec_efs_file, file_type;
type tee_efs_file, file_type;
type wifi_efs_file, file_type;
# PROC
type proc_last_kmsg, fs_type, proc_type;
# SOCKETS
type epicd_socket, file_type, data_file_type;
### SYSFS
type sysfs_argos, sysfs_type, r_fs_type, fs_type;
#type sysfs_battery, sysfs_type, r_fs_type, fs_type;
type sysfs_bbd, sysfs_type, r_fs_type, fs_type;
type sysfs_fingerprint, sysfs_type, r_fs_type, fs_type;
type sysfs_iio, sysfs_type, r_fs_type, fs_type;
type sysfs_input, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_gps, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_key, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_sensors, sysfs_type, r_fs_type, fs_type;
#type sysfs_sec_switch, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_touchscreen, sysfs_type, r_fs_type, fs_type;
type sysfs_sim, sysfs_type, r_fs_type, fs_type;
type sysfs_sensors, sysfs_type, r_fs_type, fs_type;
type sysfs_wifi, sysfs_type, r_fs_type, fs_type;
type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type;
#type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_bt_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_gps_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_lcd_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_power_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_scsi_host_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensorhub_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensors_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sim_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_spi_writeable, sysfs_type, rw_fs_type, fs_type;
#type sysfs_sec_switch_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_touchscreen_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type;
### VENDOR
type vendor_firmware_file, file_type, vendor_file_type;
# DATA
type tee_vendor_data_file, file_type, data_file_type;
# DEV SOCKET
type tz_socket, file_type;
### efs types
type radio_factoryapp_efs_file, file_type;
type factoryprop_efs_file, file_type;
type sensor_factoryapp_efs_file, file_type;
type factorymode_factoryapp_efs_file, file_type;
type baro_delta_factoryapp_efs_file, file_type;
# gps
type gps_socket, file_type;
# debugfs types
type debugfs_mali, fs_type, debugfs_type;
type debugfs_mali_mem, fs_type, debugfs_type;
type debugfs_ion, fs_type, debugfs_type;
type debugfs_ion_dma, fs_type, debugfs_type;
# cache
type boot_logcat_file, file_type, data_file_type;
# proc
type proc_extra, fs_type, proc_type;
type proc_reset_reason, fs_type, proc_type;
type proc_swapiness, fs_type, proc_type;
# data types
type display_vendor_data_file, file_type, data_file_type;
type fingerprintd_vendor_data_file, data_file_type, file_type;
type mediadrm_data_file, file_type, data_file_type;
type nfc_vendor_data_file, file_type, data_file_type;
# sysfs types
type sysfs_battery_info, sysfs_type, fs_type;
type sysfs_battery_supply, sysfs_type, rw_fs_type, fs_type;
type sysfs_abox_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensor_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_input_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_batteryinfo_charger_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_camera_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_decon, sysfs_type, r_fs_type, fs_type;
type sysfs_gpu, sysfs_type, r_fs_type, fs_type;
type sysfs_socinfo, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_mfc, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_smfc, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_fimc, sysfs_type, r_fs_type, fs_type;
type sysfs_graphics, fs_type, sysfs_type;
type sysfs_multipdp, fs_type, sysfs_type, mlstrustedobject;
type sysfs_sec, fs_type, sysfs_type, mlstrustedobject;
type sysfs_gps, fs_type, sysfs_type, mlstrustedobject;
type sysfs_brightness, fs_type, sysfs_type, mlstrustedobject;
type sysfs_virtual, fs_type, sysfs_type, mlstrustedobject;
type sysfs_fuelgauge, fs_type, sysfs_type, mlstrustedobject;
type sysfs_charger, fs_type, sysfs_type, mlstrustedobject;
type sysfs_modem, fs_type, sysfs_type, mlstrustedobject;
type sysfs_camera, fs_type, sysfs_type, mlstrustedobject;
type sysfs_mmc_host_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_ss_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_usb_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_gpu_writable, sysfs_type, rw_fs_type, fs_type;
### DATA
type biometrics_vendor_data_file, file_type, data_file_type;
type conn_vendor_data_file, file_type, data_file_type;
type gps_vendor_data_file, file_type, data_file_type;
type log_vendor_data_file, file_type, data_file_type;
type log_cbd_vendor_data_file, file_type, data_file_type;
type radio_vendor_data_file, file_type, data_file_type;
type wifi_vendor_data_file, file_type, data_file_type;
# EFS
type app_efs_file, file_type;
type battery_efs_file, file_type;
type bin_nv_data_efs_file, file_type;
type cpk_efs_file, file_type;
type imei_efs_file, file_type;
type nfc_efs_file, file_type;
type pfw_efs_file, file_type;
type prov_efs_file, file_type;
type sec_efs_file, file_type;
type tee_efs_file, file_type;
type wifi_efs_file, file_type;
# PROC
type proc_last_kmsg, fs_type, proc_type;
# SOCKETS
type epicd_socket, file_type, data_file_type;
### SYSFS
type sysfs_argos, sysfs_type, r_fs_type, fs_type;
#type sysfs_battery, sysfs_type, r_fs_type, fs_type;
type sysfs_bbd, sysfs_type, r_fs_type, fs_type;
type sysfs_fingerprint, sysfs_type, r_fs_type, fs_type;
type sysfs_iio, sysfs_type, r_fs_type, fs_type;
type sysfs_input, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_gps, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_key, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_sensors, sysfs_type, r_fs_type, fs_type;
#type sysfs_sec_switch, sysfs_type, r_fs_type, fs_type;
type sysfs_sec_touchscreen, sysfs_type, r_fs_type, fs_type;
type sysfs_sim, sysfs_type, r_fs_type, fs_type;
type sysfs_sensors, sysfs_type, r_fs_type, fs_type;
type sysfs_wifi, sysfs_type, r_fs_type, fs_type;
type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type;
#type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_bt_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_gps_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_lcd_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_power_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_scsi_host_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensorhub_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensors_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sim_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_spi_writeable, sysfs_type, rw_fs_type, fs_type;
#type sysfs_sec_switch_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_touchscreen_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type;
### VENDOR
type vendor_firmware_file, file_type, vendor_file_type;
# DATA
type tee_vendor_data_file, file_type, data_file_type;
# DEV SOCKET
type tz_socket, file_type;
### efs types
type radio_factoryapp_efs_file, file_type;
type factoryprop_efs_file, file_type;
type sensor_factoryapp_efs_file, file_type;
type factorymode_factoryapp_efs_file, file_type;
type baro_delta_factoryapp_efs_file, file_type;
# gps
type gps_socket, file_type;
# debugfs types
type debugfs_mali, fs_type, debugfs_type;
type debugfs_mali_mem, fs_type, debugfs_type;
type debugfs_ion, fs_type, debugfs_type;
type debugfs_ion_dma, fs_type, debugfs_type;
# cache
type boot_logcat_file, file_type, data_file_type;
# proc
type proc_extra, fs_type, proc_type;
type proc_reset_reason, fs_type, proc_type;
type proc_swapiness, fs_type, proc_type;
# data types
type display_vendor_data_file, file_type, data_file_type;
type fingerprintd_vendor_data_file, data_file_type, file_type;
type mediadrm_data_file, file_type, data_file_type;
type nfc_vendor_data_file, file_type, data_file_type;
# sysfs types
type sysfs_battery_info, sysfs_type, fs_type;
type sysfs_battery_supply, sysfs_type, rw_fs_type, fs_type;
type sysfs_abox_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_sensor_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_input_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_batteryinfo_charger_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_camera_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_decon, sysfs_type, r_fs_type, fs_type;
type sysfs_gpu, sysfs_type, r_fs_type, fs_type;
type sysfs_socinfo, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_mfc, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_smfc, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_fimc, sysfs_type, r_fs_type, fs_type;
type sysfs_graphics, fs_type, sysfs_type;
type sysfs_multipdp, fs_type, sysfs_type, mlstrustedobject;
type sysfs_sec, fs_type, sysfs_type, mlstrustedobject;
type sysfs_gps, fs_type, sysfs_type, mlstrustedobject;
type sysfs_brightness, fs_type, sysfs_type, mlstrustedobject;
type sysfs_virtual, fs_type, sysfs_type, mlstrustedobject;
type sysfs_fuelgauge, fs_type, sysfs_type, mlstrustedobject;
type sysfs_charger, fs_type, sysfs_type, mlstrustedobject;
type sysfs_modem, fs_type, sysfs_type, mlstrustedobject;
type sysfs_camera, fs_type, sysfs_type, mlstrustedobject;
type sysfs_mmc_host_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_ss_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_usb_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_gpu_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_info, sysfs_type, r_fs_type, fs_type;

View file

@ -212,7 +212,10 @@
/(vendor|system/vendor)/bin/hw/android\.hardware\.usb@[0-9]\.[0-9]-service\.exynos7884B u:object_r:hal_usb_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.gnss@[0-9]\.[0-9]-service u:object_r:hal_gnss_default_exec:s0
/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@2.1-service\.samsung-multihal u:object_r:hal_sensors_default_exec:s0
# SamsungParts
/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.battery@1\.0-service u:object_r:hal_battery_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.flashlight@1\.0-service u:object_r:hal_flashlight_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.gpu@1\.0-service u:object_r:hal_gpu_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.eureka\.security\.selinux@1\.0-service u:object_r:hal_selinux_default_exec:s0

View file

@ -2,3 +2,13 @@ type hal_battery_default, domain;
type hal_battery_default_exec, exec_type, file_type, vendor_file_type;
add_hwservice(hal_battery_default, hal_battery_hwservice);
init_daemon_domain(hal_battery_default);
hwbinder_use(hal_battery_default);
get_prop(hal_battery_default, hwservicemanager_prop);
allow hal_battery_default sysfs_sec_switch:dir { search };
allow hal_battery_default sysfs_sec_switch_writable:file rw_file_perms;
allow hal_battery_default sysfs_battery_writable:file rw_file_perms;
allow hal_battery_default sysfs_sec_switch_writable:dir { search };
allow hal_battery_default sysfs_battery_writable:dir { search };
allow hal_battery_default sysfs_battery:dir { search };

View file

@ -2,3 +2,8 @@ type hal_flashlight_default, domain;
type hal_flashlight_default_exec, exec_type, file_type, vendor_file_type;
add_hwservice(hal_flashlight_default, hal_flashlight_hwservice);
init_daemon_domain(hal_flashlight_default);
hwbinder_use(hal_flashlight_default);
get_prop(hal_flashlight_default, hwservicemanager_prop);
allow hal_flashlight_default sysfs_flashlight:file { read open write getattr };
allow hal_flashlight_default sysfs_flashlight:dir search;

View file

@ -0,0 +1,9 @@
type hal_gpu_default, domain;
type hal_gpu_default_exec, exec_type, file_type, vendor_file_type;
add_hwservice(hal_gpu_default, hal_gpu_hwservice);
init_daemon_domain(hal_gpu_default);
hwbinder_use(hal_gpu_default);
get_prop(hal_gpu_default, hwservicemanager_prop)
allow system_app sysfs_gpu_tmu:file { read open write getattr };
allow system_app sysfs_gpu_tmu:dir search;

View file

@ -0,0 +1,9 @@
type hal_selinux_default, domain;
type hal_selinux_default_exec, exec_type, file_type, vendor_file_type;
add_hwservice(hal_selinux_default, hal_selinux_hwservice);
init_daemon_domain(hal_selinux_default);
hwbinder_use(hal_selinux_default)
get_prop(hal_selinux_default, hwservicemanager_prop)
allow hal_selinux_default selinuxfs:file rw_file_perms;
allow hal_selinux_default selinuxfs:dir search;

View file

@ -1,3 +1,5 @@
type rild_hwservice, hwservice_manager_type;
type hal_battery_hwservice, hwservice_manager_type;
type hal_flashlight_hwservice, hwservice_manager_type;
type hal_gpu_hwservice, hwservice_manager_type;
type hal_selinux_hwservice, hwservice_manager_type;

View file

@ -7,4 +7,5 @@ vendor.lineage.power::ILineagePower u:object_r:hal_power_hwservice:s0
# SamsungParts
vendor.eureka.hardware.battery::IBattery u:object_r:hal_battery_hwservice:s0
vendor.eureka.hardware.flashlight::IFlashlight u:object_r:hal_flashlight_hwservice:s0
vendor.eureka.hardware.gpu::IGpu u:object_r:hal_gpu_hwservice:s0
vendor.eureka.security.selinux::ISELinux u:object_r:hal_selinux_hwservice:s0