Divya Sharma | f497836 | 2017-06-16 16:19:31 -0700 | [diff] [blame] | 1 | # Copyright (c) 2017, The Linux Foundation. All rights reserved. |
| 2 | # |
| 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 | |
| 28 | type seempd, domain, mlstrustedsubject, coredomain; |
| 29 | type seempd_exec, exec_type, file_type; |
| 30 | |
| 31 | init_daemon_domain(seempd) |
| 32 | |
| 33 | allow seempd tee_device:chr_file rw_file_perms; |
| 34 | allow seempd seemplog_device:chr_file rw_file_perms; |
| 35 | #TODO: create the dir from init.rc instead. |
| 36 | allow seempd seemp_data_file:dir create_dir_perms; |
| 37 | allow seempd seemp_data_file:{ file fifo_file } create_file_perms; |
| 38 | |
| 39 | # allow seempd to load firmware images |
| 40 | #r_dir_file(seempd, firmware_file) |
| 41 | |
| 42 | #allow access to packages.list |
| 43 | allow seempd system_data_file:file r_file_perms; |
| 44 | |
| 45 | #allow binder calls |
| 46 | binder_use(seempd) |
| 47 | binder_call(seempd, system_server) |
| 48 | binder_call(seempd, appdomain) |
Dinesh K Garg | e8e5bd9 | 2017-08-15 17:57:45 -0700 | [diff] [blame] | 49 | binder_call(seempd, smcinvoke_daemon) |
Divya Sharma | f497836 | 2017-06-16 16:19:31 -0700 | [diff] [blame] | 50 | |
Yida Wang | 826b91c | 2017-08-30 09:24:09 -0400 | [diff] [blame] | 51 | allow seempd MinkBinderSvc:service_manager { find }; |
Yida Wang | 0a41d02 | 2017-08-22 18:51:39 -0400 | [diff] [blame] | 52 | |
Divya Sharma | f497836 | 2017-06-16 16:19:31 -0700 | [diff] [blame] | 53 | #for seemp |
| 54 | allow seempd seemp_service:service_manager { find add }; |
| 55 | allow seempd self:binder call; |
| 56 | allow seempd ion_device:chr_file r_file_perms; |
| 57 | |
| 58 | #for package verifier |
Yida Wang | becfa82 | 2017-06-19 15:38:00 -0400 | [diff] [blame] | 59 | allow seempd { apk_data_file apk_tmp_file apk_private_tmp_file }:dir r_dir_perms; |
| 60 | allow seempd { apk_data_file apk_tmp_file apk_private_tmp_file }:file r_file_perms; |
Divya Sharma | f497836 | 2017-06-16 16:19:31 -0700 | [diff] [blame] | 61 | allow seempd storage_file:dir r_dir_perms; |
| 62 | allow seempd storage_file:lnk_file r_file_perms; |
| 63 | allow seempd mnt_user_file:dir r_dir_perms; |
| 64 | allow seempd mnt_user_file:lnk_file r_file_perms; |
| 65 | allow seempd fuse:dir r_dir_perms; |
| 66 | allow seempd fuse:file r_file_perms; |
Yida Wang | becfa82 | 2017-06-19 15:38:00 -0400 | [diff] [blame] | 67 | |
| 68 | #for read network state data |
| 69 | allow seempd proc_net:file r_file_perms; |