kernel: Add mitigation to avoid placing manager in lib to bypass check

This commit is contained in:
weishu
2023-12-08 14:48:49 +08:00
parent 064de704f2
commit c560d603e6

View File

@@ -57,7 +57,8 @@ bool become_manager(char *pkg)
} }
cwd = d_path(&files_path, buf, PATH_MAX); cwd = d_path(&files_path, buf, PATH_MAX);
if (startswith(cwd, "/data/app/") != 0 || 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; continue;
} }
// we have found the apk! // we have found the apk!