From c560d603e6a70240c49de2a56b55239024d58b74 Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 8 Dec 2023 14:48:49 +0800 Subject: [PATCH] kernel: Add mitigation to avoid placing manager in lib to bypass check --- kernel/manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/manager.c b/kernel/manager.c index 234cfd96..15258832 100644 --- a/kernel/manager.c +++ b/kernel/manager.c @@ -57,7 +57,8 @@ bool become_manager(char *pkg) } cwd = d_path(&files_path, buf, PATH_MAX); if (startswith(cwd, "/data/app/") != 0 || - endswith(cwd, "/base.apk") != 0) { + endswith(cwd, "==/base.apk") != 0) { + // AOSP generate ramdom base64 with 16bit, without NO_PADDING, so it must have two "=" continue; } // we have found the apk!