2013-11-13 00:34:52 +01:00
|
|
|
# android user-space log manager
|
2016-09-24 23:26:45 +02:00
|
|
|
type logd, domain, mlstrustedsubject;
|
2013-11-13 00:34:52 +01:00
|
|
|
type logd_exec, exec_type, file_type;
|
|
|
|
|
2016-01-28 04:23:10 +01:00
|
|
|
# Read access to pseudo filesystems.
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(logd, cgroup)
|
2016-01-28 04:23:10 +01:00
|
|
|
r_dir_file(logd, proc)
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(logd, proc_meminfo)
|
2016-01-28 04:23:10 +01:00
|
|
|
r_dir_file(logd, proc_net)
|
|
|
|
|
2016-07-20 23:12:59 +02:00
|
|
|
allow logd self:capability { setuid setgid setpcap sys_nice audit_control };
|
2014-04-01 20:02:57 +02:00
|
|
|
allow logd self:capability2 syslog;
|
2016-05-17 06:12:17 +02:00
|
|
|
allow logd self:netlink_audit_socket { create_socket_perms_no_ioctl nlmsg_write };
|
2014-04-01 20:02:57 +02:00
|
|
|
allow logd kernel:system syslog_read;
|
2014-04-07 23:04:30 +02:00
|
|
|
allow logd kmsg_device:chr_file w_file_perms;
|
2016-09-10 01:27:17 +02:00
|
|
|
allow logd system_data_file:{ file lnk_file } r_file_perms;
|
2013-11-13 00:34:52 +01:00
|
|
|
|
2016-01-04 16:20:45 +01:00
|
|
|
# Access device logging gating property
|
|
|
|
get_prop(logd, device_logging_prop)
|
|
|
|
|
2013-11-13 00:34:52 +01:00
|
|
|
r_dir_file(logd, domain)
|
|
|
|
|
2014-10-16 00:49:37 +02:00
|
|
|
allow logd kernel:system syslog_mod;
|
|
|
|
|
2015-03-10 21:46:37 +01:00
|
|
|
control_logd(logd)
|
|
|
|
|
2013-11-13 00:34:52 +01:00
|
|
|
###
|
|
|
|
### 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;
|
|
|
|
|
2016-12-05 23:01:28 +01:00
|
|
|
# ... and nobody may ptrace me (except on userdebug or eng builds)
|
|
|
|
neverallow { domain userdebug_or_eng(`-debuggerd') } logd:process ptrace;
|
|
|
|
|
2013-11-13 00:34:52 +01:00
|
|
|
# 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;
|
2016-12-06 17:57:23 +01:00
|
|
|
|
|
|
|
# Only init is allowed to enter the logd domain via exec()
|
|
|
|
neverallow { domain -init } logd:process transition;
|
|
|
|
neverallow * logd:process dyntransition;
|