1*e4a36f41SAndroid Build Coastguard Workertypeattribute logpersist coredomain; 2*e4a36f41SAndroid Build Coastguard Worker 3*e4a36f41SAndroid Build Coastguard Worker# android debug log storage in logpersist domains (eng and userdebug only) 4*e4a36f41SAndroid Build Coastguard Workeruserdebug_or_eng(` 5*e4a36f41SAndroid Build Coastguard Worker 6*e4a36f41SAndroid Build Coastguard Worker r_dir_file(logpersist, cgroup) 7*e4a36f41SAndroid Build Coastguard Worker 8*e4a36f41SAndroid Build Coastguard Worker allow logpersist misc_logd_file:file create_file_perms; 9*e4a36f41SAndroid Build Coastguard Worker allow logpersist misc_logd_file:dir rw_dir_perms; 10*e4a36f41SAndroid Build Coastguard Worker 11*e4a36f41SAndroid Build Coastguard Worker allow logpersist self:global_capability_class_set sys_nice; 12*e4a36f41SAndroid Build Coastguard Worker allow logpersist pstorefs:dir search; 13*e4a36f41SAndroid Build Coastguard Worker allow logpersist pstorefs:file r_file_perms; 14*e4a36f41SAndroid Build Coastguard Worker 15*e4a36f41SAndroid Build Coastguard Worker control_logd(logpersist) 16*e4a36f41SAndroid Build Coastguard Worker unix_socket_connect(logpersist, logdr, logd) 17*e4a36f41SAndroid Build Coastguard Worker read_runtime_log_tags(logpersist) 18*e4a36f41SAndroid Build Coastguard Worker 19*e4a36f41SAndroid Build Coastguard Worker') 20*e4a36f41SAndroid Build Coastguard Worker 21*e4a36f41SAndroid Build Coastguard Worker# logpersist is allowed to write to /data/misc/log for userdebug and eng builds 22*e4a36f41SAndroid Build Coastguard Workerneverallow logpersist { 23*e4a36f41SAndroid Build Coastguard Worker file_type 24*e4a36f41SAndroid Build Coastguard Worker userdebug_or_eng(`-misc_logd_file -coredump_file') 25*e4a36f41SAndroid Build Coastguard Worker with_native_coverage(`-method_trace_data_file') 26*e4a36f41SAndroid Build Coastguard Worker}:file { create write append }; 27*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -init -dumpstate -incidentd userdebug_or_eng(`-logpersist -logd') } misc_logd_file:file no_rw_file_perms; 28*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -init userdebug_or_eng(`-logpersist -logd') } misc_logd_file:file no_w_file_perms; 29*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -init userdebug_or_eng(`-logpersist -logd') } misc_logd_file:dir { add_name link relabelfrom remove_name rename reparent rmdir write }; 30