From 599958d1148c1137bee925f4cf08eda7f8050d98 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 13 Dec 2018 08:28:44 -0800 Subject: [PATCH] llkd: adbd is allowed to be a bad parent on userdebug If an errant process is identified, and the parent is adbd, on userdebug builds bypass monitoring the process. Test: unit tests Bug: 120983740 Change-Id: I2af0797504326b0e95aa4377918b35d17716a6a2 --- llkd/README.md | 2 +- llkd/include/llkd.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llkd/README.md b/llkd/README.md index 3da7a2f36..224e184d2 100644 --- a/llkd/README.md +++ b/llkd/README.md @@ -160,7 +160,7 @@ size of 92. NB: false is a very very very unlikely process to want to blacklist. #### ro.llk.blacklist.parent -default 0,2 (kernel and [kthreadd]). +default 0,2,adbd (kernel, [kthreadd] and adbd). The string "*false*" is the equivalent to an *empty* list. Do not watch processes that have this parent. A parent process can be comm, cmdline or pid reference. diff --git a/llkd/include/llkd.h b/llkd/include/llkd.h index b16b1d8e3..1efa32b74 100644 --- a/llkd/include/llkd.h +++ b/llkd/include/llkd.h @@ -55,7 +55,11 @@ unsigned llkCheckMilliseconds(void); #define LLK_BLACKLIST_PROCESS_DEFAULT \ "0,1,2,init,[kthreadd],[khungtaskd],lmkd,llkd,watchdogd,[watchdogd],[watchdogd/0]" #define LLK_BLACKLIST_PARENT_PROPERTY "ro.llk.blacklist.parent" +#ifdef __PTRACE_ENABLED__ // defined if userdebug build +#define LLK_BLACKLIST_PARENT_DEFAULT "0,2,[kthreadd],adbd" +#else #define LLK_BLACKLIST_PARENT_DEFAULT "0,2,[kthreadd]" +#endif #define LLK_BLACKLIST_UID_PROPERTY "ro.llk.blacklist.uid" #define LLK_BLACKLIST_UID_DEFAULT "" #define LLK_BLACKLIST_STACK_PROPERTY "ro.llk.blacklist.process.stack"