summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTholkappiyan Agaram Raghupathy <traghu@codeaurora.org>2015-11-17 18:50:34 -0800
committerSteve Kondik <steve@cyngn.com>2016-08-05 00:19:12 -0700
commit43335cdefae071d933fb12c189cccc2ee7e833a6 (patch)
treec569d06e04e05f3f704332dc6c65db63d2f14f47
parent242e02cf4c3bb17bdad2351049cff7390f81a2c8 (diff)
downloadandroid_device_qcom_sepolicy-43335cdefae071d933fb12c189cccc2ee7e833a6.tar.gz
android_device_qcom_sepolicy-43335cdefae071d933fb12c189cccc2ee7e833a6.tar.bz2
android_device_qcom_sepolicy-43335cdefae071d933fb12c189cccc2ee7e833a6.zip
SElinux policy rules addition for early audio feature
For early audio feature to work in selinux enforce mode, sepolicy rules are added earlyaudio native app and QTIMusicPlayer app in msm8960 folder and corresponding design changes are done in earlyaudio native app and QTIMusicPlayer app. Change-Id: I0c8e7d8bf2697406c256131d4c643bc850de52a4
-rw-r--r--msm8960/drmserver.te28
-rw-r--r--msm8960/earlyaudio.te49
-rw-r--r--msm8960/file.te2
-rwxr-xr-xmsm8960/file_contexts3
-rw-r--r--msm8960/install.te30
-rw-r--r--msm8960/mediaserver.te28
-rw-r--r--msm8960/property_contexts3
-rw-r--r--msm8960/qtimusic_app.te34
-rw-r--r--msm8960/seapp_contexts28
-rw-r--r--msm8960/system_server.te2
10 files changed, 206 insertions, 1 deletions
diff --git a/msm8960/drmserver.te b/msm8960/drmserver.te
new file mode 100644
index 00000000..84672e4e
--- /dev/null
+++ b/msm8960/drmserver.te
@@ -0,0 +1,28 @@
+#Copyright (c) 2015, 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.
+
+binder_call(drmserver, earlyaudio)
diff --git a/msm8960/earlyaudio.te b/msm8960/earlyaudio.te
new file mode 100644
index 00000000..1ac4fa18
--- /dev/null
+++ b/msm8960/earlyaudio.te
@@ -0,0 +1,49 @@
+#Copyright (c) 2015, 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.
+
+type earlyaudio, domain;
+init_daemon_domain(earlyaudio)
+type earlyaudio_exec , exec_type, file_type;
+
+
+binder_use(earlyaudio)
+# set audio property
+set_prop(earlyaudio, audio_prop)
+
+#Talk to mediaserver over binder
+binder_call(earlyaudio, mediaserver)
+unix_socket_connect(earlyaudio, vold, vold)
+
+allow earlyaudio earlyaudio_data_file:dir rw_dir_perms;
+allow earlyaudio earlyaudio_data_file:file create_file_perms;
+
+allow earlyaudio media_rw_data_file:dir r_dir_perms;
+allow earlyaudio media_rw_data_file:file r_file_perms;
+allow earlyaudio mediaserver_service:service_manager find;
+allow earlyaudio storage_file:dir r_dir_perms;
+allow earlyaudio fuse:dir r_dir_perms;
+allow earlyaudio fuse:file r_file_perms;
diff --git a/msm8960/file.te b/msm8960/file.te
index e8a78cc5..53303dc4 100644
--- a/msm8960/file.te
+++ b/msm8960/file.te
@@ -28,3 +28,5 @@
#efs file types
type efs_data_file, file_type, data_file_type;
type mpdecision_socket, file_type;
+type qtimusic_app_data_file, file_type, data_file_type;
+type earlyaudio_data_file, file_type, data_file_type;
diff --git a/msm8960/file_contexts b/msm8960/file_contexts
index ae0f939a..9546ce7c 100755
--- a/msm8960/file_contexts
+++ b/msm8960/file_contexts
@@ -43,9 +43,10 @@
/system/bin/efks u:object_r:mdm_helper_exec:s0
/system/bin/DR_AP_Service u:object_r:location_exec:s0
/system/bin/boot u:object_r:bootanim_exec:s0
-
+/system/bin/earlyaudio u:object_r:earlyaudio_exec:s0
###################################
# Data files
#
/data/qcks(/.*)? u:object_r:efs_data_file:s0
/sys/bootkpi/marker_entry u:object_r:sys_bootkpi:s0
+/data/misc/earlyaudio(/.*)? u:object_r:earlyaudio_data_file:s0
diff --git a/msm8960/install.te b/msm8960/install.te
new file mode 100644
index 00000000..88d2f0f5
--- /dev/null
+++ b/msm8960/install.te
@@ -0,0 +1,30 @@
+#Copyright (c) 2015, 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.
+
+allow installd { qtimusic_app_data_file} :dir { create_dir_perms relabelfrom relabelto };
+allow installd { qtimusic_app_data_file} :lnk_file { create_file_perms relabelfrom relabelto };
+allow installd { qtimusic_app_data_file } :{ file sock_file fifo_file } { getattr unlink rename relabelfrom relabelto setattr };
diff --git a/msm8960/mediaserver.te b/msm8960/mediaserver.te
new file mode 100644
index 00000000..16f0917c
--- /dev/null
+++ b/msm8960/mediaserver.te
@@ -0,0 +1,28 @@
+#Copyright (c) 2015, 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.
+
+binder_call(mediaserver, earlyaudio)
diff --git a/msm8960/property_contexts b/msm8960/property_contexts
index 67841d9e..2c011b05 100644
--- a/msm8960/property_contexts
+++ b/msm8960/property_contexts
@@ -30,3 +30,6 @@ ctl.thermal-engine u:object_r:ctl_thermal-engine_prop:s0
persist.nativehmi.exit u:object_r:ctl_bootanim_prop:s0
nativehmi.appname u:object_r:ctl_bootanim_prop:s0
sys.mediaserver.ready u:object_r:audio_prop:s0
+early.audionative.id u:object_r:audio_prop:s0
+early.audio.start u:object_r:audio_prop:s0
+early.audioapp.id u:object_r:audio_prop:s0
diff --git a/msm8960/qtimusic_app.te b/msm8960/qtimusic_app.te
new file mode 100644
index 00000000..1a026f10
--- /dev/null
+++ b/msm8960/qtimusic_app.te
@@ -0,0 +1,34 @@
+#Copyright (c) 2015, 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.
+
+type qtimusic_app, domain;
+app_domain(qtimusic_app)
+allow qtimusic_app { app_api_service system_api_service mediaserver_service surfaceflinger_service } : service_manager find;
+set_prop(qtimusic_app, audio_prop)
+allow qtimusic_app earlyaudio_data_file:dir rw_dir_perms;
+allow qtimusic_app earlyaudio_data_file:file create_file_perms;
+binder_call(qtimusic_app, mediaserver)
diff --git a/msm8960/seapp_contexts b/msm8960/seapp_contexts
new file mode 100644
index 00000000..48c44f24
--- /dev/null
+++ b/msm8960/seapp_contexts
@@ -0,0 +1,28 @@
+#Copyright (c) 2015, 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.
+
+user=system seinfo=platform name=com.qualcomm.qti.esg.auto.demo.music.allplay.phoneplayer domain=qtimusic_app type=qtimusic_app_data_file
diff --git a/msm8960/system_server.te b/msm8960/system_server.te
index 0185b373..e8259268 100644
--- a/msm8960/system_server.te
+++ b/msm8960/system_server.te
@@ -3,3 +3,5 @@ allow system_server init:unix_dgram_socket sendto;
#For gss
allow system_server gss_device:chr_file rw_file_perms;
+allow system_server qtimusic_app_data_file:file rw_file_perms;
+allow system_server qtimusic_app_data_file:dir r_dir_perms;