summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Martins <bgcngm@gmail.com>2018-06-04 21:11:32 +0100
committerBruno Martins <bgcngm@gmail.com>2018-06-04 22:09:30 +0100
commit2d7d40129ba7e04cbc8a10ad7b480dc9280284c5 (patch)
tree7fc53b293d54c79a80a940c1cb24bc9fd80934af
parentfba2a81e4746c11cfabb9772048dc1885b897429 (diff)
downloadandroid_device_qcom_sepolicy-2d7d40129ba7e04cbc8a10ad7b480dc9280284c5.tar.gz
android_device_qcom_sepolicy-2d7d40129ba7e04cbc8a10ad7b480dc9280284c5.tar.bz2
android_device_qcom_sepolicy-2d7d40129ba7e04cbc8a10ad7b480dc9280284c5.zip
sepolicy: Allow mm-qcamerad to access v4L "name" node
* Label additional nodes and add it as common rule, since it doesn't apply only to msm8953. Change-Id: I42b329d782795feed776b09d5c12d89be9bac868
-rw-r--r--common/file_contexts2
-rw-r--r--common/mm-qcamerad.te3
-rw-r--r--msm8953/genfs_contexts29
-rw-r--r--msm8953/mm-qcamerad.te29
4 files changed, 5 insertions, 58 deletions
diff --git a/common/file_contexts b/common/file_contexts
index 2839cea0..d3f65f80 100644
--- a/common/file_contexts
+++ b/common/file_contexts
@@ -435,6 +435,8 @@
/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,mdss_mdp/bw_mode_bitmap u:object_r:sysfs_graphics:s0
/sys/devices/soc\.0/[a-z0-9]+\.qcom,mdss_mdp/bw_mode_bitmap u:object_r:sysfs_graphics:s0
/sys/devices/soc\.0/[a-z0-9]+\.qcom,mdss_mdp/caps u:object_r:sysfs_graphics:s0
+/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,fd/video4linux/video[0-9]+/name(/.*)? u:object_r:sysfs_graphics:s0
+/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,msm-cam/video4linux/video[0-9]+/name(/.*)? u:object_r:sysfs_graphics:s0
/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,mdss_cam/video4linux/video[0-9]+/name(/.*)? u:object_r:sysfs_graphics:s0
/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,mdss_rotator/video4linux/video[0-9]+/name(/.*)? u:object_r:sysfs_graphics:s0
/sys/devices(/platform)?/soc/[a-z0-9]+\.qcom,mdss_rotator/caps u:object_r:sysfs_graphics:s0
diff --git a/common/mm-qcamerad.te b/common/mm-qcamerad.te
index 52134947..70e14d11 100644
--- a/common/mm-qcamerad.te
+++ b/common/mm-qcamerad.te
@@ -87,3 +87,6 @@ allow mm-qcamerad self:socket create_socket_perms;
allowxperm mm-qcamerad self:socket ioctl msm_sock_ipc_ioctls;
allow mm-qcamerad sysfs_data:file r_file_perms;
+
+#for v4L node "name" access
+allow mm-qcamerad sysfs_graphics:file rw_file_perms;
diff --git a/msm8953/genfs_contexts b/msm8953/genfs_contexts
deleted file mode 100644
index a6df7878..00000000
--- a/msm8953/genfs_contexts
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2018, The Linux Foundation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-# * Neither the name of The Linux Foundation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-genfscon sysfs /devices/platform/soc/1b00000.qcom,msm-cam/video4linux/video0/name u:object_r:sysfs_graphics:s0
-
diff --git a/msm8953/mm-qcamerad.te b/msm8953/mm-qcamerad.te
deleted file mode 100644
index 354b6133..00000000
--- a/msm8953/mm-qcamerad.te
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2018, The Linux Foundation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-# * Neither the name of The Linux Foundation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#for v4L node "name" access
-allow mm-qcamerad sysfs_graphics:file rw_file_perms;