Add binderized context hub HAL

Add context hub HAL implementation to the build, with new sepolicy files
that resolve these denials:

type=1400 audit(4779207.059:418): avc: denied { write } for pid=809
comm="android.hardwar" name="chre" dev="tmpfs" ino=32491
scontext=u:r:hal_contexthub_default:s0
tcontext=u:object_r:socket_device:s0 tclass=sock_file permissive=1

type=1400 audit(5568590.159:45): avc: denied { connectto } for pid=734
comm="android.hardwar" path="/dev/socket/chre"
scontext=u:r:hal_contexthub_default:s0 tcontext=u:r:chre:s0
tclass=unix_stream_socket permissive=1

Bug: 35808469
Test: confirm HAL gets loaded, VTS passes, no denials from
      hal_contexthub_default
Change-Id: I1882571c0541de78242755cd4b3b1548365a388b
This commit is contained in:
Brian Duddie
2017-03-28 16:55:08 -07:00
parent f41ff958d8
commit dfdaceabf2
5 changed files with 16 additions and 0 deletions

View File

@@ -301,6 +301,11 @@ PRODUCT_PACKAGES += \
fs_config_dirs \ fs_config_dirs \
fs_config_files fs_config_files
# Context hub HAL
PRODUCT_PACKAGES += \
android.hardware.contexthub@1.0-impl.generic \
android.hardware.contexthub@1.0-service
# Boot control HAL # Boot control HAL
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.boot@1.0-impl \ android.hardware.boot@1.0-impl \

View File

@@ -37,6 +37,12 @@
<instance>legacy/0</instance> <instance>legacy/0</instance>
</interface> </interface>
</hal> </hal>
<hal format="hidl">
<name>android.hardware.contexthub</name>
<transport>hwbinder</transport>
<impl level="generic"></impl>
<version>1.0</version>
</hal>
<hal format="hidl"> <hal format="hidl">
<name>android.hardware.graphics.allocator</name> <name>android.hardware.graphics.allocator</name>
<transport>hwbinder</transport> <transport>hwbinder</transport>

View File

@@ -24,6 +24,7 @@ type perfd_socket, file_type;
type ims_socket, file_type; type ims_socket, file_type;
type cnd_socket, file_type; type cnd_socket, file_type;
type chre_socket, file_type;
type firmware_file, fs_type, contextmount_type; type firmware_file, fs_type, contextmount_type;

View File

@@ -34,6 +34,7 @@
/dev/easelcomm-client u:object_r:easel_device:s0 /dev/easelcomm-client u:object_r:easel_device:s0
# dev socket nodes # dev socket nodes
/dev/socket/chre u:object_r:chre_socket:s0
/dev/socket/qmux_audio(/.*)? u:object_r:qmuxd_socket:s0 /dev/socket/qmux_audio(/.*)? u:object_r:qmuxd_socket:s0
/dev/socket/qmux_bluetooth(/.*)? u:object_r:qmuxd_socket:s0 /dev/socket/qmux_bluetooth(/.*)? u:object_r:qmuxd_socket:s0
/dev/socket/qmux_gps(/.*)? u:object_r:qmuxd_socket:s0 /dev/socket/qmux_gps(/.*)? u:object_r:qmuxd_socket:s0

View File

@@ -0,0 +1,3 @@
# Allow context hub HAL to communicate with daemon via socket
allow hal_contexthub_default chre:unix_stream_socket connectto;
allow hal_contexthub_default chre_socket:sock_file write;