kernel: nuke creds wrapper

* Little bit complicated, so let's remove it.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
rsuntk
2025-08-26 23:14:36 +07:00
committed by ShirkNeko
parent 165558d588
commit f3f2089a13
5 changed files with 25 additions and 69 deletions

View File

@@ -24,7 +24,6 @@
#include "klog.h" // IWYU pragma: keep
#include "ksud.h"
#include "kernel_compat.h"
#include "include/ksu_creds.h"
#define SU_PATH "/system/bin/su"
#define SH_PATH "/system/bin/sh"
@@ -67,7 +66,7 @@ int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,
#endif
#ifndef CONFIG_KSU_SUSFS_SUS_SU
if (!ksu_is_allow_uid(ksu_current_uid())) {
if (!ksu_is_allow_uid(current_uid().val)) {
return 0;
}
#endif
@@ -117,7 +116,7 @@ int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags)
#endif
#ifndef CONFIG_KSU_SUSFS_SUS_SU
if (!ksu_is_allow_uid(ksu_current_uid())) {
if (!ksu_is_allow_uid(current_uid().val)) {
return 0;
}
#endif
@@ -182,7 +181,7 @@ int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,
return 0;
#ifndef CONFIG_KSU_SUSFS_SUS_SU
if (!ksu_is_allow_uid(ksu_current_uid()))
if (!ksu_is_allow_uid(current_uid().val))
return 0;
#endif
@@ -232,7 +231,7 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user,
if (likely(memcmp(path, su, sizeof(su))))
return 0;
if (!ksu_is_allow_uid(ksu_current_uid()))
if (!ksu_is_allow_uid(current_uid().val))
return 0;
pr_info("sys_execve su found\n");
@@ -249,7 +248,7 @@ static int ksu_inline_handle_devpts(struct inode *inode)
return 0;
}
uid_t uid = ksu_current_uid();
uid_t uid = current_uid().val;
if (uid % 100000 < 10000) {
// not untrusted_app, ignore it
return 0;