kernel: remove unused CONFIG guard becuase GKI kernel enable kprobe by default

This commit is contained in:
weishu
2025-02-16 21:38:59 +08:00
parent 4593ae81c7
commit 500ff9bcbc
4 changed files with 0 additions and 60 deletions

View File

@@ -189,8 +189,6 @@ int ksu_handle_devpts(struct inode *inode)
return 0;
}
#ifdef CONFIG_KPROBES
static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
{
struct pt_regs *real_regs = PT_REAL_REGS(regs);
@@ -232,8 +230,6 @@ static int pts_unix98_lookup_pre(struct kprobe *p, struct pt_regs *regs)
return ksu_handle_devpts(inode);
}
#endif
static struct kprobe *init_kprobe(const char *name,
kprobe_pre_handler_t handler)
{
@@ -269,19 +265,15 @@ static struct kprobe *su_kps[4];
// sucompat: permited process can execute 'su' to gain root access.
void ksu_sucompat_init()
{
#ifdef CONFIG_KPROBES
su_kps[0] = init_kprobe(SYS_EXECVE_SYMBOL, execve_handler_pre);
su_kps[1] = init_kprobe(SYS_FACCESSAT_SYMBOL, faccessat_handler_pre);
su_kps[2] = init_kprobe(SYS_NEWFSTATAT_SYMBOL, newfstatat_handler_pre);
su_kps[3] = init_kprobe("pts_unix98_lookup", pts_unix98_lookup_pre);
#endif
}
void ksu_sucompat_exit()
{
#ifdef CONFIG_KPROBES
for (int i = 0; i < ARRAY_SIZE(su_kps); i++) {
destroy_kprobe(&su_kps[i]);
}
#endif
}