[Google Pixel 3 XL ROMs, Kernels, Recoveries, & Oth] k0rner:
SElinux-related bug

On the latest stable build (AOSiP-9.0-Official-blueline-20190604), I've discovered a bug with few services failing to start due to incorrect SELinux labels (or possibly other issues).

System continuously (every five seconds ) tries to restart them, which leads to unnecessary background activity and possible battery drain.

The services are:

ss_ramdump

qteeconnector-hal-1-0

qti_esepowermanager_service

qdutils_disp-1-0

Here is a logcat excerpt with the issue:

06-11 21:52:49.878 1 1 E init : File /vendor/bin/hw/vendor.qti.esepowermanager@1.0-service(labeled "u:object_r:vendor_file:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials
06-11 21:52:49.878 1 1 I init : starting service 'qti_esepowermanager_service'...
06-11 21:52:49.878 5247 5247 W audit : audit_lost=50 audit_rate_limit=5 audit_backlog_limit=64
06-11 21:52:49.878 5247 5247 E audit : rate limit exceeded
06-11 21:52:49.878 5247 5247 E init : cannot execve('/vendor/bin/hw/vendor.qti.esepowermanager@1.0-service'): Permission denied
06-11 21:52:49.879 1 1 E init : File /vendor/bin/hw/vendor.qti.hardware.qdutils_disp@1.0-service-qti(labeled "u:object_r:vendor_file:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials
06-11 21:52:49.879 1 1 I init : starting service 'qdutils_disp-1-0'...
06-11 21:52:49.879 5249 5249 E init : cannot execve('/vendor/bin/hw/vendor.qti.hardware.qdutils_disp@1.0-service-qti'): Permission denied
06-11 21:52:49.879 1 1 E init : File /vendor/bin/hw/vendor.qti.hardware.qteeconnector@1.0-service(labeled "u:object_r:vendor_file:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials
06-11 21:52:49.879 1 1 I init : starting service 'qteeconnector-hal-1-0'...
06-11 21:52:49.880 1 1 I init : Service 'qti_esepowermanager_service' (pid 5247) exited with status 127
06-11 21:52:49.880 1 1 I init : Sending signal 9 to service 'qti_esepowermanager_service' (pid 5247) process group...
06-11 21:52:49.880 5250 5250 E init : cannot execve('/vendor/bin/hw/vendor.qti.hardware.qteeconnector@1.0-service'): Permission denied
06-11 21:52:49.880 1 1 I libprocessgroup: Successfully killed process cgroup uid 1000 pid 5247 in 0ms
06-11 21:52:49.880 1 1 I init : Service 'qdutils_disp-1-0' (pid 5249) exited with status 127
06-11 21:52:49.880 1 1 I init : Sending signal 9 to service 'qdutils_disp-1-0' (pid 5249) process group...
06-11 21:52:49.880 1 1 I libprocessgroup: Successfully killed process cgroup uid 1000 pid 5249 in 0ms
06-11 21:52:49.881 1 1 I init : Service 'qteeconnector-hal-1-0' (pid 5250) exited with status 127
06-11 21:52:49.881 1 1 I init : Sending signal 9 to service 'qteeconnector-hal-1-0' (pid 5250) process group...
06-11 21:52:49.881 1 1 I libprocessgroup: Successfully killed process cgroup uid 1000 pid 5250 in 0ms
06-11 21:52:50.134 1 1 E init : File /vendor/bin/subsystem_ramdump(labeled "u:object_r:subsystem_ramdump_exec:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials
06-11 21:52:50.134 1 1 I init : starting service 'ss_ramdump'...
06-11 21:52:50.135 5356 5356 E init : cannot execve('/vendor/bin/subsystem_ramdump'): Permission denied
06-11 21:52:55.142 1 1 I init : Service 'ss_ramdump' (pid 5955) exited with status 127
06-11 21:52:55.142 1 1 I init : Sending signal 9 to service 'ss_ramdump' (pid 5955) process group...

As a workaround, one may create an executable file in /data/adb/post-fs-data.d of the following content:

#!/system/bin/sh
sleep 30
stop ss_ramdump
stop qteeconnector-hal-1-0
stop qti_esepowermanager_service
stop qdutils_disp-1-0

which stops auto-restart of these services (non-functional anyway) in 30 seconds after boot.

Here is activity graph before and after the workaround (red line):

https://i.imgur.com/5ssAeY8.png

Is it possible to fix this issue properly in one of the next builds?

Many thanks.