diff --git a/proprietary-files.txt b/proprietary-files.txt index 83d3f0a..0194f3e 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -779,9 +779,6 @@ vendor/lib/libqti-perfd.so|2a2077cf455d5a6b03c0bb2b6eeca554ee28a363 vendor/lib/libqti-perfd-client.so|a4a6da47ee26fcd5116c514f7fed15b91306aea3 vendor/lib/libqti-util.so|d65f3ef240cebea73bd1ba8b1132a7e639aa05bb -# Perf (perfd) - from LineageOS/android_device_lge_msm8996-common -vendor/bin/perfd|fa726c3874918611457dfb17d47f6f8c9aa8bdc7 - # Power-off charging bin/lpm lib64/libmaet.so diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 8990e2d..075bf10 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -334,12 +334,10 @@ on post-fs-data setprop vold.post_fs_data_done 1 - # Create PERFD deamon related dirs - mkdir /data/misc/perfd 0755 root system - chmod 2755 /data/misc/perfd - mkdir /data/system/perfd 0770 root system - rm /data/system/perfd/default_values - chmod 2770 /data/system/perfd + #Create PERFD deamon related dirs + mkdir /data/vendor/perfd 0770 root system + chmod 2770 /data/vendor/perfd + rm /data/vendor/perfd/default_values #Create IOP deamon related dirs mkdir /data/vendor/iop 0700 root system diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index d490fac..6a1e222 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -465,12 +465,6 @@ service vendor.energy-awareness /vendor/bin/energy-awareness group system oneshot -service vendor.perfd /vendor/bin/perfd - class main - user root - group root system - writepid /dev/cpuset/system-background/tasks - #service vendor.hvdcp_opti /system/vendor/bin/hvdcp_opti # class main # user root diff --git a/sepolicy/cameraserver.te b/sepolicy/cameraserver.te index 5fecc10..3cd205d 100644 --- a/sepolicy/cameraserver.te +++ b/sepolicy/cameraserver.te @@ -1,9 +1,3 @@ -# communicate with perfd -allow cameraserver mpctl_data_file:dir search; -allow cameraserver mpctl_data_file:sock_file write; -allow cameraserver mpctl_socket:dir search; -allow cameraserver mpctl_socket:sock_file write; - allow cameraserver csc_prop:file { getattr open read }; allow cameraserver hal_perf_default:binder call; diff --git a/sepolicy/file.te b/sepolicy/file.te index 370d74b..5d54acb 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -1,5 +1,4 @@ # data -type perfd_data_file, file_type, core_data_file_type, data_file_type; type camera_socket, file_type, core_data_file_type, data_file_type; type biometrics_vendor_data_file, data_file_type, file_type; type vendor_audiopcm_data_file, data_file_type, file_type; @@ -54,7 +53,6 @@ type sysfs_camera_writable, fs_type, sysfs_type; type sysfs_fpc, fs_type, sysfs_type; type sysfs_lcd_writable, fs_type, sysfs_type; type sysfs_mdnie_writable, fs_type, sysfs_type; -type sysfs_power_management, fs_type, sysfs_type; type sysfs_sec_keypad, fs_type, sysfs_type; type sysfs_tsp, fs_type, sysfs_type; type sysfs_wifi, fs_type, sysfs_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index ce6d798..79d5f8f 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -176,17 +176,11 @@ /(vendor|system/vendor)/bin/hw/android\.hardware\.health@2\.0-service\.samsung u:object_r:hal_health_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.keymaster@4\.0-service\.samsung u:object_r:hal_keymaster_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.samsung u:object_r:hal_light_default_exec:s0 -/(vendor|system/vendor)/bin/hw/android\.hardware\.power@1\.1-service.gts3l u:object_r:hal_power_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.usb@1\.2-service-qti u:object_r:hal_usb_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service\.gts3l u:object_r:hal_lineage_livedisplay_sysfs_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.gts3l u:object_r:hal_lineage_touch_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.miscpower@1\.0-service u:object_r:hal_power_default_exec:s0 -# perfd -/(vendor|system/vendor)/bin/perfd u:object_r:perfd_exec:s0 -/data/misc/perfd(/.*)? u:object_r:perfd_data_file:s0 -/data/system/perfd(/.*)? u:object_r:perfd_data_file:s0 - # Rootfs /firmware(/.*)? u:object_r:firmware_file:s0 /firmware_mnt(/.*)? u:object_r:firmware_file:s0 diff --git a/sepolicy/hal_audio_default.te b/sepolicy/hal_audio_default.te index c2e6557..8c2e4cd 100644 --- a/sepolicy/hal_audio_default.te +++ b/sepolicy/hal_audio_default.te @@ -1,8 +1,3 @@ -# communicate with perfd -allow hal_audio perfd:unix_stream_socket connectto; -allow hal_audio perfd_data_file:dir search; -allow hal_audio perfd_data_file:sock_file write; - allow hal_audio_default hal_bluetooth_a2dp_hwservice:hwservice_manager { add find }; allow hal_audio_default sysfs_audio_writable:file r_file_perms; diff --git a/sepolicy/hal_camera_default.te b/sepolicy/hal_camera_default.te index 3ffb8f2..5c66ba0 100644 --- a/sepolicy/hal_camera_default.te +++ b/sepolicy/hal_camera_default.te @@ -1,8 +1,3 @@ -# communicate with perfd -allow hal_camera perfd_data_file:dir search; -allow hal_camera perfd:unix_stream_socket connectto; -allow hal_camera perfd_data_file:sock_file write; - allow hal_camera_default camera_data_file:sock_file write; allow hal_camera_default csc_prop:file { getattr open read }; diff --git a/sepolicy/hal_drm_default.te b/sepolicy/hal_drm_default.te deleted file mode 100644 index c197aa1..0000000 --- a/sepolicy/hal_drm_default.te +++ /dev/null @@ -1,4 +0,0 @@ -# communicate with perfd -allow hal_drm perfd_data_file:dir search; -allow hal_drm perfd:unix_stream_socket connectto; -allow hal_drm perfd_data_file:sock_file write; diff --git a/sepolicy/hal_graphics_composer_default.te b/sepolicy/hal_graphics_composer_default.te deleted file mode 100644 index 27fa1c8..0000000 --- a/sepolicy/hal_graphics_composer_default.te +++ /dev/null @@ -1,4 +0,0 @@ -# communicate with perfd -allow hal_graphics_composer_default perfd:unix_stream_socket connectto; -allow hal_graphics_composer_default perfd_data_file:dir search; -allow hal_graphics_composer_default perfd_data_file:sock_file write; diff --git a/sepolicy/hal_perf_default.te b/sepolicy/hal_perf_default.te index ee8f5ee..8dd4d06 100644 --- a/sepolicy/hal_perf_default.te +++ b/sepolicy/hal_perf_default.te @@ -1,6 +1,3 @@ -allow hal_perf_default post_boot_prop:file r_file_perms; -allow hal_perf_default proc_sched:file rw_file_perms; - allow hal_perf_default self:capability kill; allow hal_perf_default self:capability dac_override; @@ -12,6 +9,4 @@ allow hal_perf_default init:unix_stream_socket connectto; allow hal_perf_default vendor_default_prop:property_service set; -set_prop(hal_perf_default, vendor_freq_prop) -set_prop(hal_perf_default, vendor_mpctl_prop) get_prop(hal_perf_default, sec_camera_prop) diff --git a/sepolicy/hal_perf_default_exec.te b/sepolicy/hal_perf_default_exec.te deleted file mode 100644 index 5185b44..0000000 --- a/sepolicy/hal_perf_default_exec.te +++ /dev/null @@ -1 +0,0 @@ -allow hal_perf_default_exec post_boot_prop:file r_file_perms; diff --git a/sepolicy/hal_power_default.te b/sepolicy/hal_power_default.te index 37b4f7e..ed1620e 100644 --- a/sepolicy/hal_power_default.te +++ b/sepolicy/hal_power_default.te @@ -1,11 +1,5 @@ add_hwservice(hal_power_default, hal_miscpower_hwservice) -# communicate with perfd -allow hal_power perfd:unix_stream_socket connectto; -allow hal_power perfd_data_file:dir search; -allow hal_power perfd_data_file:sock_file write; -allow hal_power debugfs:file r_file_perms; - allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms; allow hal_power_default sysfs_batteryinfo:dir r_dir_perms; diff --git a/sepolicy/mediacodec.te b/sepolicy/mediacodec.te deleted file mode 100644 index b4fcd29..0000000 --- a/sepolicy/mediacodec.te +++ /dev/null @@ -1,9 +0,0 @@ -# communicate with perfd -allow mediacodec perfd:unix_stream_socket connectto; -allow mediacodec perfd_data_file:dir search; -allow mediacodec perfd_data_file:sock_file write; - -allow mediacodec mpctl_data_file:dir search; -allow mediacodec mpctl_data_file:sock_file write; -allow mediacodec mpctl_socket:dir search; -allow mediacodec mpctl_socket:sock_file write; diff --git a/sepolicy/mediaserver.te b/sepolicy/mediaserver.te index 7a7fb89..e43cdcb 100644 --- a/sepolicy/mediaserver.te +++ b/sepolicy/mediaserver.te @@ -1,7 +1 @@ -# communicate with perfd -allow mediadrmserver mpctl_data_file:dir search; -allow mediadrmserver mpctl_data_file:sock_file write; -allow mediadrmserver mpctl_socket:dir search; -allow mediadrmserver mpctl_socket:sock_file write; - allow mediaserver exported_camera_prop:file { open read getattr }; diff --git a/sepolicy/perfd.te b/sepolicy/perfd.te deleted file mode 100644 index 420aaf6..0000000 --- a/sepolicy/perfd.te +++ /dev/null @@ -1,51 +0,0 @@ -type perfd, domain; -type perfd_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(perfd) - -allow perfd cgroup:file r_file_perms; - -allow perfd cameraserver:process signull; - -# files in /data/misc/perfd and /data/system/perfd -typeattribute perfd data_between_core_and_vendor_violators; -allow perfd perfd_data_file:dir create_dir_perms; -allow perfd perfd_data_file:dir create_dir_perms; -allow perfd perfd_data_file:{ file sock_file } create_file_perms; - -allow perfd proc:file rw_file_perms; -allow perfd proc_sched:file r_file_perms; - -# read access /sys -r_dir_file(perfd, sysfs_type) -# normally write is not granted to the default "sysfs" label. -# In this case, perfd needs access to files in /sys that are -# commonly created and destroyed. When the kernel creates them, -# they are created with the default label "sysfs". For robustness, -# allow perfd to write to "sysfs" to ensure it can optimally -# tune the power/cpu settings. -allow perfd sysfs:file write; -allow perfd sysfs_msm_perf:file write; -##allow perfd sysfs_msm_subsys:file write; -allow perfd sysfs_devices_system_cpu:file write; -allow perfd sysfs_power_management:file write; - -allow perfd mpctl_data_file:dir rw_dir_perms; -allow perfd mpctl_data_file:file create_file_perms; -allow perfd mpctl_data_file:sock_file write; - -allow perfd proc_sched:file w_file_perms; -allow perfd gpu_device:chr_file rw_file_perms; - -allow perfd vendor_freq_prop:file { read getattr open }; -allow perfd sysfs_lib:file { write }; - -allow perfd sysfs_msm_power:file w_file_perms; -allow perfd sysfs_cpu_boost:file w_file_perms; -allow perfd sysfs_devfreq:file w_file_perms; -allow perfd sysfs_kgsl:file w_file_perms; - -# perfd uses kill(pid, 0) to determine if a process exists. -# Determining if a process exists does not require the kill capability -# since a permission denied indicates the process exists. -dontaudit perfd self:capability kill; diff --git a/sepolicy/property.te b/sepolicy/property.te index 70ab226..9af4c5f 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -4,7 +4,6 @@ type ina_status_prop, property_type; type receiver_error_prop, property_type; type sec_camera_prop, property_type, file_type; type sec_cnss_diag_prop, property_type; -type post_boot_prop, property_type; type tzdaemon_prop, property_type; type vendor_factory_prop, property_type; type vendor_members_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index a688e98..ae769cc 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -34,7 +34,6 @@ ro.vendor.radio. u:object_r:vendor_radio_prop:s0 service.camera. u:object_r:sec_camera_prop:s0 sys.audio.rotation u:object_r:exported_system_prop:s0 sys.cameramode. u:object_r:sec_camera_prop:s0 -sys.post_boot. u:object_r:post_boot_prop:s0 system.camera.CC. u:object_r:sec_camera_prop:s0 vendor.bluetooth_fw_ver u:object_r:vendor_bluetooth_prop:s0 vendor.npu.usr_drv.log_mask u:object_r:sec_camera_prop:s0 diff --git a/sepolicy/vendor_init.te b/sepolicy/vendor_init.te index f2a7e99..af7237a 100644 --- a/sepolicy/vendor_init.te +++ b/sepolicy/vendor_init.te @@ -19,8 +19,6 @@ allow vendor_init system_data_file:dir { add_name create setattr write }; allow vendor_init tombstone_data_file:dir getattr; allow vendor_init emmcblk_device:blk_file getattr; -allow vendor_init perfd_data_file:dir { create search setattr getattr open read ioctl write add_name remove_name rmdir relabelfrom }; - set_prop(vendor_init, camera_prop) set_prop(vendor_init, config_prop) set_prop(vendor_init, csc_prop)