kernel: load_allow_list when /data prepared
This commit is contained in:
@@ -92,12 +92,20 @@ static int execve_handler_pre(struct kprobe *p, struct pt_regs *regs) {
|
||||
const char sh[] = SH_PATH;
|
||||
const char su[] = SU_PATH;
|
||||
|
||||
if (!ksu_is_allow_uid(current_uid().val)) {
|
||||
filename = PT_REGS_PARM2(regs);
|
||||
if (IS_ERR(filename)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
filename = PT_REGS_PARM2(regs);
|
||||
if (IS_ERR(filename)) {
|
||||
static const char app_process[] = "/system/bin/app_process";
|
||||
static bool first_app_process = true;
|
||||
if (first_app_process && !memcmp(filename->name, app_process, sizeof(app_process) - 1)) {
|
||||
first_app_process = false;
|
||||
pr_info("exec app_process, /data prepared!\n");
|
||||
ksu_load_allow_list();
|
||||
}
|
||||
|
||||
if (!ksu_is_allow_uid(current_uid().val)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user