diff --git a/private/file_contexts b/private/file_contexts
index 7ec8d22dfb1b4913e13e06507e91cb628321470f..dee82a9798a5d862d7d1403b36bfdcd000015987 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -251,6 +251,7 @@
 /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
 /system/bin/hw/android\.hardware\.ir@1\.0-service             u:object_r:hal_ir_default_exec:s0
+/system/bin/hw/android\.hardware\.keymaster@3\.0-service      u:object_r:hal_keymaster_default_exec:s0
 /system/bin/hw/android\.hardware\.light@2\.0-service          u:object_r:hal_light_default_exec:s0
 /system/bin/hw/android\.hardware\.memtrack@1\.0-service       u:object_r:hal_memtrack_default_exec:s0
 /system/bin/hw/android\.hardware\.nfc@1\.0-service            u:object_r:hal_nfc_default_exec:s0
diff --git a/private/hal_keymaster.te b/private/hal_keymaster.te
new file mode 100644
index 0000000000000000000000000000000000000000..4c6d0d2922d605446ec08c8c7549a892a19118d6
--- /dev/null
+++ b/private/hal_keymaster.te
@@ -0,0 +1,5 @@
+type hal_keymaster_default, domain;
+hal_impl_domain(hal_keymaster_default, hal_keymaster)
+
+type hal_keymaster_default_exec, exec_type, file_type;
+init_daemon_domain(hal_keymaster_default)
diff --git a/public/attributes b/public/attributes
index 299532b369c1415dee994f71faa994a9065701fb..a2b902963b1e2964c5e5e9ac118f001221538b84 100644
--- a/public/attributes
+++ b/public/attributes
@@ -130,6 +130,7 @@ attribute hal_graphics_allocator;
 attribute hal_graphics_composer;
 attribute hal_health;
 attribute hal_ir;
+attribute hal_keymaster;
 attribute hal_light;
 attribute hal_memtrack;
 attribute hal_nfc;
diff --git a/public/hal_keymaster.te b/public/hal_keymaster.te
new file mode 100644
index 0000000000000000000000000000000000000000..a3aef59ae7cf95414a0087d134ed20954b1b18e5
--- /dev/null
+++ b/public/hal_keymaster.te
@@ -0,0 +1,7 @@
+# hwbinder access
+hwbinder_use(hal_keymaster)
+
+allow hal_keymaster tee_device:chr_file rw_file_perms;
+allow hal_keymaster tee:unix_stream_socket connectto;
+
+allow hal_keymaster ion_device:chr_file r_file_perms;
diff --git a/public/keystore.te b/public/keystore.te
index 42150176ae459d93aa961909639fee95ffbc7228..33238f3061056b64df9dac7770434b4f520b7454 100644
--- a/public/keystore.te
+++ b/public/keystore.te
@@ -6,6 +6,11 @@ typeattribute keystore mlstrustedsubject;
 binder_use(keystore)
 binder_service(keystore)
 binder_call(keystore, system_server)
+
+# talk to keymaster
+binder_call(keystore, hwservicemanager)
+binder_call(keystore, hal_keymaster)
+
 allow keystore keystore_data_file:dir create_dir_perms;
 allow keystore keystore_data_file:notdevfile_class_set create_file_perms;
 allow keystore keystore_exec:file { getattr };
diff --git a/public/vold.te b/public/vold.te
index 6baba08dab9a34ef4d20bc27c25f6ecf38a2ecb1..e80bd8bc2606daaeda49b973dcf816e05c0ae56e 100644
--- a/public/vold.te
+++ b/public/vold.te
@@ -130,6 +130,8 @@ binder_use(vold)
 binder_call(vold, healthd)
 
 # talk to keymaster
+binder_call(vold, hwservicemanager)
+binder_call(vold, hal_keymaster)
 allow vold tee_device:chr_file rw_file_perms;
 
 # Access userdata block device.