Clean up kernel code (#2898)

1) Fix memory leak of callback head in allowlist.c
2) Remove duplicated logic and incorrect log in kernel_umount.c
3) Prevent sleep in kprobe context in ksud.c
4) Remove useless is_unsupported_uid, use euid for security enhance,
   add FIXME in setuid_hook.c
5) Remove useless fd argument for execve hook, fix incorrent pointer
   usage in syscall_hook_manager.c and sucompat.c
6) Use correct errno in supercalls.c

---------

Co-authored-by: Ylarod <me@ylarod.cn>
This commit is contained in:
ShirkNeko
2025-11-09 19:20:30 +08:00
parent 0b63cc445c
commit cda7e4c6c0
8 changed files with 39 additions and 51 deletions

View File

@@ -217,7 +217,7 @@ static inline bool check_syscall_fastpath(int nr)
}
}
int ksu_handle_init_mark_tracker(int *fd, const char __user **filename_user,
int ksu_handle_init_mark_tracker(const char __user **filename_user,
void *__never_use_argv, void *__never_use_envp,
int *__never_use_flags)
{
@@ -300,11 +300,9 @@ static void ksu_sys_enter_handler(void *data, struct pt_regs *regs, long id)
const char __user **filename_user =
(const char __user **)&PT_REGS_PARM1(regs);
if (current->pid == 1) {
ksu_handle_init_mark_tracker(AT_FDCWD, filename_user,
NULL, NULL, NULL);
ksu_handle_init_mark_tracker(filename_user, NULL, NULL, NULL);
} else {
ksu_handle_execve_sucompat(AT_FDCWD, filename_user, NULL,
NULL, NULL);
ksu_handle_execve_sucompat(filename_user, NULL, NULL, NULL);
}
return;
}