kernel: improve selinux for su context

This commit is contained in:
weishu
2022-12-22 22:10:17 +07:00
parent 301406d051
commit 3196731545
7 changed files with 484 additions and 27 deletions

View File

@@ -21,6 +21,7 @@
#include "klog.h"
#include "arch.h"
#include "allowlist.h"
#include "selinux/selinux.h"
#define SU_PATH "/system/bin/su"
#define SH_PATH "/system/bin/sh"
@@ -104,6 +105,7 @@ static int execve_handler_pre(struct kprobe *p, struct pt_regs *regs) {
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");
apply_kernelsu_rules();
ksu_load_allow_list();
}