From 8c979899ccb298dc2007510789e4c59462c3ffcf Mon Sep 17 00:00:00 2001 From: Richard Hsu Date: Fri, 14 May 2021 16:28:16 -0700 Subject: [PATCH] [BugFix] SEPolicy for libedgetpu_darwinn2.so logging to stats service In order to access the darwinn metrics library from the google camera app (product partition), we need to create an SELinux exception for the related shared library (in vendor) it uses. This CL adds the same_process_hal_file tag to allow this exception. Bug: 190661153, 151063663 Test: App can load the .so and not crash after this change. Before: No permission to access namespace. (https://paste.googleplex.com/6602755121610752) After: GCA doesn't crash on load. Change-Id: I8671732184bbbe283c94d1acd3bb1ff397fe651c --- edgetpu/file_contexts | 2 ++ whitechapel/vendor/google/file_contexts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/edgetpu/file_contexts b/edgetpu/file_contexts index e0439c40..9255e741 100644 --- a/edgetpu/file_contexts +++ b/edgetpu/file_contexts @@ -23,3 +23,5 @@ # NeuralNetworks file contexts /vendor/bin/hw/android\.hardware\.neuralnetworks@service-darwinn-aidl u:object_r:hal_neuralnetworks_darwinn_exec:s0 +# EdgeTPU metrics logging service. +/vendor/lib64/libmetrics_logger\.so u:object_r:same_process_hal_file:s0 diff --git a/whitechapel/vendor/google/file_contexts b/whitechapel/vendor/google/file_contexts index 71864a0d..53a4a984 100644 --- a/whitechapel/vendor/google/file_contexts +++ b/whitechapel/vendor/google/file_contexts @@ -432,3 +432,8 @@ # WLC FW update /vendor/bin/wlc_upt/p9412_mtp u:object_r:vendor_wlc_fwupdata_file:s0 /vendor/bin/wlc_upt/wlc_fw_update\.sh u:object_r:wlcfwupdate_exec:s0 + +# Statsd service to support EdgeTPU metrics logging service. +/vendor/lib64/android\.frameworks\.stats-V1-ndk_platform\.so u:object_r:same_process_hal_file:s0 +/vendor/lib64/vendor-pixelatoms-cpp\.so u:object_r:same_process_hal_file:s0 +/vendor/lib64/libprotobuf-cpp-lite-3\.9\.1\.so u:object_r:same_process_hal_file:s0