2012-01-04 18:33:27 +01:00
|
|
|
# debugger interface
|
2016-12-10 04:14:04 +01:00
|
|
|
type debuggerd, domain;
|
2012-01-04 18:33:27 +01:00
|
|
|
type debuggerd_exec, exec_type, file_type;
|
|
|
|
|
2013-10-29 19:42:35 +01:00
|
|
|
typeattribute debuggerd mlstrustedsubject;
|
2015-11-18 01:21:38 +01:00
|
|
|
allow debuggerd self:capability { dac_override sys_ptrace chown kill fowner setuid setgid };
|
2013-10-29 19:42:35 +01:00
|
|
|
allow debuggerd self:capability2 { syslog };
|
|
|
|
allow debuggerd domain:dir r_dir_perms;
|
|
|
|
allow debuggerd domain:file r_file_perms;
|
2014-05-17 04:14:13 +02:00
|
|
|
allow debuggerd domain:lnk_file read;
|
2016-04-27 21:32:36 +02:00
|
|
|
allow debuggerd {
|
|
|
|
domain
|
|
|
|
-adbd
|
|
|
|
-debuggerd
|
|
|
|
-healthd
|
|
|
|
-init
|
|
|
|
-keystore
|
2016-12-05 23:01:28 +01:00
|
|
|
-logd
|
2016-04-27 21:32:36 +02:00
|
|
|
-ueventd
|
|
|
|
-watchdogd
|
2016-09-14 11:00:13 +02:00
|
|
|
}:process { execmem ptrace getattr };
|
2016-12-05 23:01:28 +01:00
|
|
|
|
|
|
|
userdebug_or_eng(`
|
|
|
|
allow debuggerd logd:process { execmem ptrace getattr };
|
|
|
|
')
|
|
|
|
|
2015-11-18 01:21:38 +01:00
|
|
|
allow debuggerd tombstone_data_file:dir rw_dir_perms;
|
2013-10-29 19:42:35 +01:00
|
|
|
allow debuggerd tombstone_data_file:file create_file_perms;
|
2014-08-19 02:09:38 +02:00
|
|
|
allow debuggerd shared_relro_file:dir r_dir_perms;
|
|
|
|
allow debuggerd shared_relro_file:file r_file_perms;
|
2016-03-09 03:02:15 +01:00
|
|
|
allow debuggerd domain:process { sigstop sigkill signal };
|
2016-11-08 18:08:55 +01:00
|
|
|
allow debuggerd { exec_type libart_file }:file r_file_perms;
|
2016-12-10 04:14:04 +01:00
|
|
|
allow debuggerd apk_data_file:file r_file_perms;
|
|
|
|
allow debuggerd apk_data_file:dir search;
|
2013-10-29 19:42:35 +01:00
|
|
|
# Access app library
|
|
|
|
allow debuggerd system_data_file:file open;
|
2015-01-19 02:39:53 +01:00
|
|
|
# Allow debuggerd to redirect a dump_backtrace request to itself.
|
|
|
|
# This only happens on 64 bit systems, where all requests go to the 64 bit
|
|
|
|
# debuggerd and get redirected to the 32 bit debuggerd if the process is 32 bit.
|
2015-12-04 01:10:05 +01:00
|
|
|
|
2016-05-12 03:40:27 +02:00
|
|
|
allow debuggerd {
|
|
|
|
audioserver
|
2016-05-13 02:28:34 +02:00
|
|
|
bluetooth
|
2016-05-12 03:40:27 +02:00
|
|
|
cameraserver
|
|
|
|
drmserver
|
|
|
|
inputflinger
|
|
|
|
mediacodec
|
|
|
|
mediadrmserver
|
|
|
|
mediaextractor
|
|
|
|
mediaserver
|
|
|
|
sdcardd
|
|
|
|
surfaceflinger
|
|
|
|
}:debuggerd dump_backtrace;
|
2013-09-27 16:24:49 +02:00
|
|
|
|
|
|
|
# Connect to system_server via /data/system/ndebugsocket.
|
|
|
|
unix_socket_connect(debuggerd, system_ndebug, system_server)
|
2013-11-13 00:34:52 +01:00
|
|
|
|
2014-02-06 01:36:25 +01:00
|
|
|
userdebug_or_eng(`
|
|
|
|
allow debuggerd input_device:dir r_dir_perms;
|
|
|
|
allow debuggerd input_device:chr_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
2013-11-13 00:34:52 +01:00
|
|
|
# logd access
|
|
|
|
read_logd(debuggerd)
|
2014-07-24 21:25:43 +02:00
|
|
|
|
|
|
|
# Check SELinux permissions.
|
|
|
|
selinux_check_access(debuggerd)
|
2016-09-10 01:27:17 +02:00
|
|
|
|
|
|
|
# Read /data/dalvik-cache.
|
|
|
|
allow debuggerd dalvikcache_data_file:dir { search getattr };
|
|
|
|
allow debuggerd dalvikcache_data_file:file r_file_perms;
|