platform_system_sepolicy/public/logd.te
Mark Salyzyn da62cb4dda logcat: introduce split to logd and logpersist domains
- transition to logpersist from init
- sort some overlapping negative references
- intention is to allow logpersist to be used by vendor
  userdebug logging

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Bug: 30566487
Change-Id: I7806f5a2548cbe0c1f257a0ba2855f2eb69d8e7c
2016-12-20 20:31:03 +00:00

45 lines
1.3 KiB
Text

# android user-space log manager
type logd, domain, mlstrustedsubject;
type logd_exec, exec_type, file_type;
# Read access to pseudo filesystems.
r_dir_file(logd, cgroup)
r_dir_file(logd, proc)
r_dir_file(logd, proc_meminfo)
r_dir_file(logd, proc_net)
allow logd self:capability { setuid setgid setpcap sys_nice audit_control };
allow logd self:capability2 syslog;
allow logd self:netlink_audit_socket { create_socket_perms_no_ioctl nlmsg_write };
allow logd kernel:system syslog_read;
allow logd kmsg_device:chr_file w_file_perms;
allow logd system_data_file:{ file lnk_file } r_file_perms;
# Access device logging gating property
get_prop(logd, device_logging_prop)
r_dir_file(logd, domain)
allow logd kernel:system syslog_mod;
control_logd(logd)
###
### Neverallow rules
###
### logd should NEVER do any of this
# Block device access.
neverallow logd dev_type:blk_file { read write };
# ptrace any other app
neverallow logd domain:process ptrace;
# ... and nobody may ptrace me (except on userdebug or eng builds)
neverallow { domain userdebug_or_eng(`-debuggerd') } logd:process ptrace;
# Write to /system.
neverallow logd system_file:dir_file_class_set write;
# Write to files in /data/data or system files on /data
neverallow logd { app_data_file system_data_file }:dir_file_class_set write;