Commit graph

15 commits

Author SHA1 Message Date
Steven Moreland
6a8d151ba8 Merge "Remove vendor_service." into tm-dev-plus-aosp am: be1bd1eebb
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101-sepolicy/+/19441276

Change-Id: Ia9526d71defecd28580dfd6f4619a88dc87ea58f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28 01:08:22 +00:00
Steven Moreland
81ccf8d719 Remove vendor_service.
We want to avoid associating types with where they can be used.

Bug: 237115222
Test: build
Change-Id: I4766227e2261d0d57be090933926ff3b439694f6
2022-07-27 16:50:03 +00:00
Richard Hsu
5675757d41 [SELinux] Allow NNAPI HAL to log traces to perfetto under userdebug builds
Allows DarwiNN NNAPI HAL to log traces to perfetto only under userdebug builds. This is similar to the camera HAL fix in ag/17080874

Error message:
TracingMuxer: type=1400 audit(0.0:486): avc: denied { write } for name="traced_producer" dev="tmpfs" ino=1116 scontext=u:r:hal_neuralnetworks_darwinn:s0

This rule is common for EdgeTPU in both WHI and PRO.

Bug: 231838536

Test: tested on PRO before and after the change, and the traces now shows up.

Example: https://ui.perfetto.dev/#!/?s=ab911b3972bc16a1a831e148a7446c09757a08426bbe3c3b16d31a728b1d923
https://screenshot.googleplex.com/3roWETkTFyiDjW9

Change-Id: I8d4a57e262087aa4ec6670a487d7b06d2f2cde69
2022-05-07 22:28:22 -07:00
Sean Wang
9a94f84d7b Grant selinux permission to com.google.edgetpu_vendor_service-V2-ndk.so
This change is related to ag/16062268 with modifications to the edgetpu_vendor_service

Bug: 198131843
Test: tested on oriole
Change-Id: Ic512e5878a4d6af3aeaa939868b07dd449948f45
2021-11-02 09:06:16 +00:00
qinyiyan
d60240f504 Grant selinux permission to com.google.edgetpu_app_service-V2-ndk.so
Bug: 204528053
Test: forrest build with the change. AVC denials don't show up.
Change-Id: Ic3fafeb749156967d772d5288ecf99a44ebc7031
2021-10-29 15:04:31 -07:00
qinyiyan
6e818988b6 Allow the NNAPI HAL to access edgetpu_app_service.
10-12 14:40:11.528   759   759 W Binder:759_1: type=1400 audit(0.0:23): avc: denied { call } for scontext=u:r:hal_neuralnetworks_darwinn:s0 tcontext=u:r:edgetpu_app_server:s0 tclass=binder permissive=0

10-12 18:17:04.678   440   440 E SELinux : avc:  denied  { find } for pid=753 uid=1000 name=com.google.edgetpu.IEdgeTpuAppService/default scontext=u:r:hal_neuralnetworks_darwinn:s0 tcontext=u:object_r:edgetpu_app_service:s0 tclass=service_manager permissive=0

Test: rebuilt the selinux_policy. The AVC denials don't show up.
Bug: 196697793
Change-Id: If43f7411a3324f65323ea004e34878f070d9ebeb
2021-10-12 22:21:52 +00:00
Jiyong Park
5cc5d52bd7 Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m

Change-Id: Icc9af3798ac89742fa56b1cb37d8116d99b4a9c2
2021-08-06 19:58:01 +09:00
Sina Hassani
e763f3cc9b Allow HAL to access sysfs.
This is so that it can read fw metrics from sysfs and dump them through
dumpsys.

Test: Ran dumpsys and bugreport.
Bug: 193841666
Change-Id: I08c08e35bad35d0eefc3f6ad218fb47e24051b0c
2021-07-16 16:27:34 -07:00
Franklin He
6a488b8a81 Merge "Add new sepolicy to allow Power Hint" into sc-dev 2021-06-18 08:37:19 +00:00
Franklin He
c53c03b843 Add new sepolicy to allow Power Hint
SELinux policy changes to work with https://googleplex-android-review.git.corp.google.com/c/device/google/gs101/+/14997393
This allows the NNAPI HAL to make IPC calls to the Power HAL in order to request power hints

Bug: 191241561
Test: Pushed new SEPolicy to device, verified no AVC problems when making IPC calls
Change-Id: I8209b3677bedf908901389c07304f4478d0431b0
2021-06-17 07:59:11 +00:00
Yu-Chi Cheng
643e5a7123 Allowed EdgeTPU compilation services (tflite and nnapi) to access
overcommit_memory info.

This is required as part of the compilation process, likely part of
the jemalloc which was added recently.

Bug: 190790251
Test: verified on local P21 device.
Change-Id: I4d90ea92afd7beaa4c4efa6ed509d703764932a1
2021-06-16 16:17:14 -07:00
Richard Hsu
753e62f39c Merge "[BugFix] SEPolicy for libedgetpu_darwinn2.so logging to stats service" into sc-dev 2021-06-13 06:11:41 +00:00
Richard Hsu
8c979899cc [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
2021-06-10 19:36:35 -07:00
Sung-fang Tsai
985aa698c7 qllow priv-app to access Pixel power HAL extension.
SELinux issues to solve:

native  : aion.cc:780 Error loading lib_aion_buffer.so dlopen failed: library "pixel-power-ext-V1-ndk_platform.so" not found: needed by /vendor/lib64/lib_aion_buffer.so in namespace sphal

05-23 10:11:32.055   420   420 E SELinux : avc:  denied  { find } for pid=6630 uid=10089 name=android.hardware.power.IPower/default scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:hal_power_service:s0 tclass=service_manager permissive=0

Bug: 187373665
Test: Passed, procedure listed in b/187373665#comment8 with forrest.
Change-Id: Ice7c69bca4a029a61ca1ccb7087ea01948ae5f24
2021-06-10 17:56:17 +00:00
Adam Shih
e7ed46c52c organize EdgeTPU modules and sepolicy
Bug: 190331327
Bug: 190331548
Bug: 189895600
Bug: 190331108
Bug: 182524105
Bug: 183935302
Test: build ROM and check if the modules and sepolicy are still there
Change-Id: I40391a239a16c4fe79d58fab209dcbd1a8f25ede
2021-06-09 10:39:04 +08:00