1# Copyright (c) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License
13
14type tlogcat, native_system_domain, domain;
15
16allow tlogcat dev_tee_log:chr_file { read open ioctl };
17allow tlogcat data_log:dir { create search setattr getattr read open write add_name remove_name relabelto rmdir };
18#avc:  denied  { ioctl } for  pid=677 comm="tlogcat" path="/data/log/tee/teeOS_log-0" dev="sdd80" ino=125 ioctlcmd=0x5413 scontext=u:r:tlogcat:s0 tcontext=u:object_r:data_log:s0 tclass=file permissive=1
19allow tlogcat data_log:file { open read write getattr setattr append rename create unlink ioctl };
20allow tlogcat data_log:lnk_file { getattr };
21
22#avc:  denied  { read } for  pid=654 comm="tlogcat" name="u:object_r:debug_param:s0" dev="tmpfs" ino=74 scontext=u:r:tlogcat:s0 tcontext=u:object_r:debug_param:s0 tclass=file permissive=1
23#avc:  denied  { open } for  pid=654 comm="tlogcat" path="/dev/__parameters__/u:object_r:debug_param:s0" dev="tmpfs" ino=74 scontext=u:r:tlogcat:s0 tcontext=u:object_r:debug_param:s0 tclass=file permissive=1
24#avc:  denied  { map } for  pid=654 comm="tlogcat" path="/dev/__parameters__/u:object_r:debug_param:s0" dev="tmpfs" ino=74 scontext=u:r:tlogcat:s0 tcontext=u:object_r:debug_param:s0 tclass=file permissive=1
25allow tlogcat debug_param:file { read open map };
26#avc:  denied  { search } for  pid=677 comm="tlogcat" name="/" dev="sdd80" ino=3 scontext=u:r:tlogcat:s0 tcontext=u:object_r:data_file:s0 tclass=dir permissive=1
27allow tlogcat data_file:dir { search };
28#avc:  denied  { search } for  pid=677 comm="tlogcat" name="socket" dev="tmpfs" ino=38 scontext=u:r:tlogcat:s0 tcontext=u:object_r:dev_unix_socket:s0 tclass=dir permissive=1
29allow tlogcat dev_unix_socket:dir { search };
30#avc:  denied  { read } for  pid=677 comm="tlogcat" name="u:object_r:hilog_param:s0" dev="tmpfs" ino=63 scontext=u:r:tlogcat:s0 tcontext=u:object_r:hilog_param:s0 tclass=file permissive=1
31#avc:  denied  { open } for  pid=677 comm="tlogcat" path="/dev/__parameters__/u:object_r:hilog_param:s0" dev="tmpfs" ino=63 scontext=u:r:tlogcat:s0 tcontext=u:object_r:hilog_param:s0 tclass=file permissive=1
32#avc:  denied  { map } for  pid=677 comm="tlogcat" path="/dev/__parameters__/u:object_r:hilog_param:s0" dev="tmpfs" ino=63 scontext=u:r:tlogcat:s0 tcontext=u:object_r:hilog_param:s0 tclass=file permissive=1
33allow tlogcat hilog_param:file { map open read };
34#avc:  denied  { read } for  pid=677 comm="tlogcat" name="overcommit_memory" dev="proc" ino=3092 scontext=u:r:tlogcat:s0 tcontext=u:object_r:proc_file:s0 tclass=file permissive=1
35#avc:  denied  { open } for  pid=677 comm="tlogcat" path="/proc/sys/vm/overcommit_memory" dev="proc" ino=3092 scontext=u:r:tlogcat:s0 tcontext=u:object_r:proc_file:s0 tclass=file permissive=1
36allow tlogcat proc_file:file { open read };
37#avc:  denied  { entrypoint } for  pid=677 comm="init" path="/system/bin/tlogcat" dev="sdd76" ino=428 scontext=u:r:tlogcat:s0 tcontext=u:object_r:system_bin_file:s0 tclass=file permissive=1
38#avc:  denied  { map } for  pid=677 comm="tlogcat" path="/system/bin/tlogcat" dev="sdd76" ino=428 scontext=u:r:tlogcat:s0 tcontext=u:object_r:system_bin_file:s0 tclass=file permissive=1
39#avc:  denied  { read } for  pid=677 comm="tlogcat" path="/system/bin/tlogcat" dev="sdd76" ino=428 scontext=u:r:tlogcat:s0 tcontext=u:object_r:system_bin_file:s0 tclass=file permissive=1
40#avc:  denied  { execute } for  pid=677 comm="tlogcat" path="/system/bin/tlogcat" dev="sdd76" ino=428 scontext=u:r:tlogcat:s0 tcontext=u:object_r:system_bin_file:s0 tclass=file permissive=1
41allow tlogcat system_bin_file:file { entrypoint execute map read };
42
43typeattribute tlogcat public_violator_data_log_dir_createwrite;
44typeattribute tlogcat public_violator_data_log_file_createwrite;
45