rosemary: sepolicy: Address Health HAL denials

Signed-off-by: bengris32 <bengris32@protonmail.ch>
Change-Id: I8d4c4d1d792a2a8ad0a4af1f7a49a2f2e1202c9d
This commit is contained in:
bengris32
2022-09-24 20:01:55 +01:00
committed by Matsvei Niaverau
parent 96606d4e79
commit 876008ec0a
3 changed files with 26 additions and 0 deletions

View File

@@ -2,6 +2,15 @@
type vendor_fingerprint_data_file, data_file_type, file_type;
type vendor_fingerprint_device, dev_type;
# Health
type vendor_sysfs_ac_supply, fs_type, sysfs_type;
type vendor_sysfs_battery_supply, fs_type, sysfs_type;
type vendor_sysfs_usb_supply, fs_type, sysfs_type;
type vendor_sysfs_charger_supply, fs_type, sysfs_type;
type vendor_sysfs_bms_supply, fs_type, sysfs_type;
type vendor_sysfs_parallel_supply, fs_type, sysfs_type;
type vendor_sysfs_main_supply, fs_type, sysfs_type;
# Performance
type proc_vm_dirty, fs_type, proc_type;
type proc_sched_stune, fs_type, proc_type;

View File

@@ -1,3 +1,12 @@
# Health
genfscon sysfs /devices/platform/mt_charger/power_supply/ac u:object_r:vendor_sysfs_ac_supply:s0
genfscon sysfs /devices/platform/mt_charger/power_supply/usb u:object_r:vendor_sysfs_usb_supply:s0
genfscon sysfs /devices/platform/mt_charger/power_supply/main u:object_r:vendor_sysfs_main_supply:s0
genfscon sysfs /devices/platform/mt_charger/power_supply/charger u:object_r:vendor_sysfs_charger_supply:s0
genfscon sysfs /devices/platform/battery/power_supply/battery u:object_r:vendor_sysfs_battery_supply:s0
genfscon sysfs /devices/platform/battery/power_supply/bms u:object_r:vendor_sysfs_bms_supply:s0
genfscon sysfs /devices/platform/11004000.i2c7/i2c-7/7-0055/power_supply/parallel u:object_r:vendor_sysfs_parallel_supply:s0
# Leds
genfscon sysfs /devices/platform/11016000.i2c5/i2c-5/5-0034/mt6360_pmu_rgbled.4.auto/leds u:object_r:sysfs_leds:s0
genfscon sysfs /devices/platform/leds-mt65xx/leds/lcd-backlight u:object_r:sysfs_leds:s0

8
sepolicy/vendor/hal_health_default.te vendored Normal file
View File

@@ -0,0 +1,8 @@
r_dir_file(hal_health_default, vendor_sysfs_usb_supply)
r_dir_file(hal_health_default, vendor_sysfs_ac_supply)
r_dir_file(hal_health_default, vendor_sysfs_battery_supply)
r_dir_file(hal_health_default, vendor_sysfs_charger_supply)
r_dir_file(hal_health_default, vendor_sysfs_bms_supply)
r_dir_file(hal_health_default, vendor_sysfs_parallel_supply)
r_dir_file(hal_health_default, vendor_sysfs_main_supply)
r_dir_file(hal_health_default, sysfs_batteryinfo)