kernel: clean memory when exit

This commit is contained in:
weishu
2024-03-24 16:41:45 +08:00
parent ef404cb619
commit d8671b14d1
6 changed files with 40 additions and 13 deletions

View File

@@ -242,7 +242,7 @@ static struct kprobe execve_kp = {
#endif
// sucompat: permited process can execute 'su' to gain root access.
void ksu_enable_sucompat()
void ksu_sucompat_init()
{
#ifdef CONFIG_KPROBES
int ret;
@@ -254,3 +254,11 @@ void ksu_enable_sucompat()
pr_info("sucompat: faccessat_kp: %d\n", ret);
#endif
}
void ksu_sucompat_exit() {
#ifdef CONFIG_KPROBES
unregister_kprobe(&execve_kp);
unregister_kprobe(&newfstatat_kp);
unregister_kprobe(&faccessat_kp);
#endif
}