diff --git a/private/file_contexts b/private/file_contexts index 6f8f7416af44d1c5ffebf0d90a804d8f1ef16781..5b5b7d50986dc9fca24cd61fb637d523c8492dc3 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -233,6 +233,7 @@ /system/bin/hw/android\.hardware\.boot@1\.0-service u:object_r:hal_boot_exec:s0 /system/bin/hw/android\.hardware\.contexthub@1\.0-service u:object_r:hal_contexthub_default_exec:s0 /system/bin/hw/android\.hardware\.dumpstate@1\.0-service u:object_r:hal_dumpstate_default_exec:s0 +/system/bin/hw/android\.hardware\.gatekeeper@1\.0-service u:object_r:hal_gatekeeper_default_exec:s0 /system/bin/hw/android\.hardware\.graphics\.allocator@2\.0-service u:object_r:hal_graphics_allocator_default_exec:s0 /system/bin/hw/android\.hardware\.graphics\.composer@2\.1-service u:object_r:hal_graphics_composer_default_exec:s0 /system/bin/hw/android\.hardware\.health@1\.0-service u:object_r:hal_health_default_exec:s0 diff --git a/private/hal_gatekeeper_default.te b/private/hal_gatekeeper_default.te new file mode 100644 index 0000000000000000000000000000000000000000..e0c5613367c5dff117391d95e2530b9c70757337 --- /dev/null +++ b/private/hal_gatekeeper_default.te @@ -0,0 +1,4 @@ +type hal_gatekeeper_default, hal_gatekeeper, domain; +type hal_gatekeeper_default_exec, exec_type, file_type; + +init_daemon_domain(hal_gatekeeper_default); diff --git a/public/attributes b/public/attributes index faf6b974298c6922c82bd4dd3123d51a39bc8da5..9bed18da238df653cae43b05a90739a6c924c628 100644 --- a/public/attributes +++ b/public/attributes @@ -117,6 +117,7 @@ attribute update_engine_common; # HALs attribute hal_audio; attribute hal_dumpstate; +attribute hal_gatekeeper; attribute hal_graphics_allocator; attribute hal_graphics_composer; attribute hal_health; diff --git a/public/gatekeeperd.te b/public/gatekeeperd.te index f6ec1abbf1c9751d806dcae1f584147d405233a9..3831dff71fdf82adac3dac3eb4cd1a2c6a8af424 100644 --- a/public/gatekeeperd.te +++ b/public/gatekeeperd.te @@ -1,11 +1,10 @@ -type gatekeeperd, domain; +# normally uses HAL; implements HAL in pass-through mode only +type gatekeeperd, hal_gatekeeper, domain; type gatekeeperd_exec, exec_type, file_type; # gatekeeperd binder_service(gatekeeperd) binder_use(gatekeeperd) -allow gatekeeperd tee_device:chr_file rw_file_perms; -allow gatekeeperd ion_device:chr_file r_file_perms; # need to find KeyStore and add self allow gatekeeperd gatekeeper_service:service_manager { add find }; @@ -20,6 +19,7 @@ allow gatekeeperd keystore:keystore_key { add_auth }; # For permissions checking allow gatekeeperd system_server:binder call; allow gatekeeperd permission_service:service_manager find; + # For parent user ID lookup allow gatekeeperd user_service:service_manager find; diff --git a/public/hal_gatekeeper.te b/public/hal_gatekeeper.te new file mode 100644 index 0000000000000000000000000000000000000000..27912b7652655fb1e03e936be9a613bd285b6804 --- /dev/null +++ b/public/hal_gatekeeper.te @@ -0,0 +1,9 @@ +# hwbinder access +hwbinder_use(hal_gatekeeper) + +# call into gatekeeperd process (callbacks) +binder_call(hal_gatekeeper, gatekeeperd) + +# TEE access. +allow hal_gatekeeper tee_device:chr_file rw_file_perms; +allow hal_gatekeeper ion_device:chr_file r_file_perms;