Fix Trusty log file permissions and ownership

Bug: 190050919
Test: build, boot

Change-Id: If899f52095ab79b2515fa8befca2c314428fffec
diff --git a/sepolicy/device.te b/sepolicy/device.te
new file mode 100644
index 0000000..92eda83
--- /dev/null
+++ b/sepolicy/device.te
@@ -0,0 +1 @@
+type logbuffer_device, dev_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 9e27b2e..ccfee13 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -1,4 +1,5 @@
 /dev/trusty-ipc-dev0                 u:object_r:tee_device:s0
+/dev/trusty-log0                     u:object_r:logbuffer_device:s0
 /dev/vport3p1                        u:object_r:rpmb_virt_device:s0
 /dev/vport3p2                        u:object_r:spi_virt_device:s0
 /vendor/bin/dhcpclient               u:object_r:dhcpclient_exec:s0
diff --git a/sepolicy/logd.te b/sepolicy/logd.te
new file mode 100644
index 0000000..cc55e20
--- /dev/null
+++ b/sepolicy/logd.te
@@ -0,0 +1,2 @@
+r_dir_file(logd, logbuffer_device)
+allow logd logbuffer_device:chr_file r_file_perms;
diff --git a/ueventd.qemu_trusty.rc b/ueventd.qemu_trusty.rc
index b24d068..7e46bba 100644
--- a/ueventd.qemu_trusty.rc
+++ b/ueventd.qemu_trusty.rc
@@ -2,3 +2,4 @@
 /dev/vport3p1             0660   system     system
 /dev/vport3p2             0660   system     system
 /dev/trusty-ipc-dev0      0660   system     drmrpc
+/dev/trusty-log0          0660   system     system