blob: 529ab9678fc460c18258db847f33ae079038273d [file] [log] [blame]
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +05301# Copyright (c) 2015,2017 The Linux Foundation. All rights reserved.
Avijit Kanti Das1dfec922015-06-24 17:20:50 -07002#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met:
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of The Linux Foundation nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
jaihindy0b66b8c2017-07-31 17:43:11 +053028#as the exec is defined in file_context it is hitting build
29# error in user build so moving out of the macro
30type qti-testscripts_exec, exec_type, file_type;
31
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070032userdebug_or_eng(`
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +053033 typeattribute qti-testscripts coredomain;
sahil madekaa3608c92017-05-12 15:41:40 -070034 permissive qti-testscripts;
jaihindy0b66b8c2017-07-31 17:43:11 +053035 init_daemon_domain(qti-testscripts)
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070036
jaihindy0b66b8c2017-07-31 17:43:11 +053037 #this is shell scripts and need /system/bin/sh
38 allow qti-testscripts shell_exec:file rx_file_perms;
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070039 #super_user - start
40 # Add qti-testscripts to various domains
41 net_domain(qti-testscripts)
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070042
43 dontaudit qti-testscripts self:capability_class_set *;
44 dontaudit qti-testscripts kernel:security *;
45 dontaudit qti-testscripts kernel:system *;
46 dontaudit qti-testscripts self:memprotect *;
47 dontaudit qti-testscripts domain:process *;
48 dontaudit qti-testscripts domain:fd *;
49 dontaudit qti-testscripts domain:dir *;
50 dontaudit qti-testscripts domain:lnk_file *;
51 dontaudit qti-testscripts domain:{ fifo_file file } *;
52 dontaudit qti-testscripts domain:socket_class_set *;
53 dontaudit qti-testscripts domain:ipc_class_set *;
54 dontaudit qti-testscripts domain:key *;
55 dontaudit qti-testscripts fs_type:filesystem *;
56 dontaudit qti-testscripts {fs_type dev_type file_type}:dir_file_class_set *;
57 dontaudit qti-testscripts node_type:node *;
58 dontaudit qti-testscripts node_type:{ tcp_socket udp_socket rawip_socket } *;
59 dontaudit qti-testscripts netif_type:netif *;
60 dontaudit qti-testscripts port_type:socket_class_set *;
61 dontaudit qti-testscripts port_type:{ tcp_socket dccp_socket } *;
62 dontaudit qti-testscripts domain:peer *;
63 dontaudit qti-testscripts domain:binder *;
64 dontaudit qti-testscripts property_type:property_service *;
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +053065 dontaudit qti-testscripts property_type:file *;
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070066 dontaudit qti-testscripts service_manager_type:service_manager *;
67 dontaudit qti-testscripts keystore:keystore_key *;
Divya Sharmad8172c12017-01-20 14:29:16 -080068 # dontaudit qti-testscripts domain:debuggerd *;
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070069 dontaudit qti-testscripts domain:drmservice *;
70 dontaudit qti-testscripts unlabeled:filesystem *;
71 #super_user - end
Biswajit Paulde72e442015-08-20 14:54:27 -070072
73 #Added below rule in same file to keep all debug policies
74 #under one common file.
75
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070076 # All domains can read proc enrty of qti-testscripts
77 r_dir_file(domain, qti-testscripts)
78 r_dir_file(qti-testscripts, domain)
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +053079
80# allow adbd qti-testscripts:process dyntransition;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053081 #allow { domain -mediaextractor -mediacodec } qti-testscripts:unix_stream_socket connectto;
Biswajit Paulde72e442015-08-20 14:54:27 -070082 allow domain qti-testscripts:fd use;
Salendarsingh Gaud86a42442017-09-01 18:35:15 +053083 allow { domain -mediaextractor -mediacodec -hal_configstore_server } qti-testscripts:unix_stream_socket { getattr getopt read write shutdown };
Siddeswar Aluganti759e1892017-01-12 18:25:28 -080084# binder_call({ domain -init -netd }, qti-testscripts)
Biswajit Paulde72e442015-08-20 14:54:27 -070085 allow domain qti-testscripts:fifo_file { write getattr };
86 allow domain qti-testscripts:process sigchld;
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +053087 binder_use(qti-testscripts)
Ravi Kumar Siddojigarid8145102017-10-23 23:32:58 +053088 hwbinder_use(qti-testscripts)
Ravi Kumar Siddojigari5404ec32017-07-07 13:34:54 +053089 allow platform_app qti-testscripts:unix_stream_socket { read write connectto};
90 allow system_app qti-testscripts:unix_stream_socket { read write connectto};
91 allow system_server qti-testscripts:binder { transfer call };
92 allow untrusted_app_25 qti-testscripts:binder { transfer call };
93 allow priv_app qti-testscripts:binder { transfer call };
94 allow surfaceflinger qti-testscripts:binder { transfer call };
95 allow system_server qti-testscripts:fifo_file read;
Jaihind Yadav937f9b82017-11-17 18:33:02 +053096 binder_call(platform_app, qti-testscripts)
97 binder_call(system_app, qti-testscripts)
98
Avijit Kanti Das1dfec922015-06-24 17:20:50 -070099')