universal7885: sepolicy: rework for unify

This commit is contained in:
roynatech2544 2022-02-18 14:12:06 +09:00
commit 4be8e028a2
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
9 changed files with 40 additions and 67 deletions

View file

@ -218,10 +218,7 @@
/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file: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
/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.parts@[0-9]\.[0-9]-service u:object_r:hal_parts_default_exec:s0
/dev/radio0 u:object_r:fm_radio_device:s0
/factory(/.*)? u:object_r:sec_efs_file:s0

View file

@ -1,16 +0,0 @@
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 };
allow hal_battery_default sysfs_virtual:dir { search };
allow hal_battery_default self:capability setuid;

View file

@ -1,11 +0,0 @@
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;
allow hal_flashlight_default sysfs_virtual:dir { search };

View file

@ -1,9 +0,0 @@
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 hal_gpu_default sysfs_gpu_tmu:file { read open write getattr };
allow hal_gpu_default sysfs_gpu_tmu:dir search;

View file

@ -0,0 +1,31 @@
type hal_parts_default, domain;
type hal_parts_default_exec, exec_type, file_type, vendor_file_type;
add_hwservice(hal_parts_default, hal_parts_hwservice);
init_daemon_domain(hal_parts_default);
hwbinder_use(hal_parts_default);
get_prop(hal_parts_default, hwservicemanager_prop);
# Battery
allow hal_parts_default sysfs_sec_switch:dir { search };
allow hal_parts_default sysfs_sec_switch_writable:file rw_file_perms;
allow hal_parts_default sysfs_battery_writable:file rw_file_perms;
allow hal_parts_default sysfs_sec_switch_writable:dir { search };
allow hal_parts_default sysfs_battery_writable:dir { search };
allow hal_parts_default sysfs_battery:dir { search };
allow hal_parts_default sysfs_virtual:dir search;
allow hal_parts_default self:capability setuid;
# FlashLight
allow hal_parts_default sysfs_flashlight:file { read open write getattr };
allow hal_parts_default sysfs_flashlight:dir search;
allow hal_parts_default sysfs_virtual:dir search;
# GPU
allow hal_parts_default sysfs_gpu_tmu:file { read open write getattr };
allow hal_parts_default sysfs_gpu_tmu:dir search;
# SELinux
allow hal_parts_default selinuxfs:file rw_file_perms;
allow hal_parts_default selinuxfs:dir search;

View file

@ -1,9 +0,0 @@
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,7 +1,4 @@
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;
type hal_parts_hwservice, hwservice_manager_type;
type hal_vendor_configstore_hwservice, hwservice_manager_type;
type hal_vendor_surfaceflinger_hwservice, hwservice_manager_type;

View file

@ -5,10 +5,10 @@ vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:rild_hwse
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
vendor.eureka.hardware.parts::IBattery u:object_r:hal_parts_hwservice:s0
vendor.eureka.hardware.parts::IFlashLight u:object_r:hal_parts_hwservice:s0
vendor.eureka.hardware.parts::IGpu u:object_r:hal_parts_hwservice:s0
vendor.eureka.security.parts::ISELinux u:object_r:hal_parts_hwservice:s0
vendor.samsung_slsi.hardware.ExynosHWCServiceTW::IExynosHWCServiceTW u:object_r:hal_vendor_surfaceflinger_hwservice:s0
vendor.samsung_slsi.hardware.configstore::IExynosHWCConfigs u:object_r:hal_vendor_configstore_hwservice:s0

View file

@ -12,16 +12,9 @@ allow system_app sysfs_battery_info:file { read open getattr };
r_dir_file(system_app, sysfs_battery_info)
# SamsungParts
#
allow system_app hal_battery_hwservice:hwservice_manager find;
allow system_app hal_flashlight_hwservice:hwservice_manager find;
allow system_app hal_selinux_hwservice:hwservice_manager find;
allow system_app hal_gpu_hwservice:hwservice_manager find;
allow system_app hal_parts_hwservice:hwservice_manager find;
allow system_app hal_battery_default:binder call;
allow system_app hal_flashlight_default:binder call;
allow system_app hal_selinux_default:binder call;
allow system_app hal_gpu_default:binder call;
allow system_app hal_parts_default:binder call;
allow system_app fm_radio_device:chr_file { read write open ioctl };