From f39a66a7900b9886aef73f63ba643dd546d82d96 Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Mon, 1 Jul 2019 08:47:52 +0200 Subject: [PATCH] universal7580: sepolicy: label video4linux sysfs nodes Change-Id: I051d99f1d6195da668e5ba5b51c08782aacd6acd --- sepolicy/file.te | 1 + sepolicy/genfs_contexts | 3 +++ sepolicy/mediacodec.te | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sepolicy/file.te b/sepolicy/file.te index 7081466..dedd5a6 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -45,6 +45,7 @@ type sysfs_graphics, sysfs_type, fs_type, mlstrustedobject; type sysfs_ion, sysfs_type, fs_type, mlstrustedobject; type sysfs_block, sysfs_type, fs_type, mlstrustedobject; type sysfs_jack, sysfs_type, fs_type, mlstrustedobject; +type sysfs_v4l, sysfs_type, fs_type, mlstrustedobject; allow sysfs_type tmpfs:filesystem associate; diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts index 2cd8f71..00a80db 100644 --- a/sepolicy/genfs_contexts +++ b/sepolicy/genfs_contexts @@ -100,3 +100,6 @@ genfscon sysfs /devices/virtual/net/rmnet3 u:object_r:sysfs_net:s0 genfscon sysfs /devices/14830000.decon_fb u:object_r:sysfs_graphics:s0 genfscon sysfs /devices/14800000.dsim u:object_r:sysfs_graphics:s0 + +# video4linux +genfscon sysfs /devices/12800000.mfc0/video4linux/ u:object_r:sysfs_v4l:s0 diff --git a/sepolicy/mediacodec.te b/sepolicy/mediacodec.te index 39d6840..524c8e7 100644 --- a/sepolicy/mediacodec.te +++ b/sepolicy/mediacodec.te @@ -1,5 +1,6 @@ # /system/lib/omx/ allow mediacodec system_file:dir r_dir_perms; -# /sys/class/video4linux/video6/name -allow mediacodec sysfs:file r_file_perms; +# /sys/class/video4linux/* +allow mediacodec sysfs_v4l:dir { open read search }; +allow mediacodec sysfs_v4l:file r_file_perms; -- 2.20.1