From ae104ed4a4fd3c64bda8f6996180543096fbe1f4 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Sun, 9 Nov 2025 16:41:54 +0800 Subject: [PATCH] kernel: Remove redundant checks --- kernel/kernel_umount.c | 22 ---------------------- kernel/setuid_hook.c | 2 -- 2 files changed, 24 deletions(-) diff --git a/kernel/kernel_umount.c b/kernel/kernel_umount.c index 77d0728d..44618e43 100644 --- a/kernel/kernel_umount.c +++ b/kernel/kernel_umount.c @@ -166,23 +166,6 @@ static void umount_tw_func(struct callback_head *cb) kfree(tw); } -static inline bool is_appuid(uid_t uid) -{ -#define PER_USER_RANGE 100000 -#define FIRST_APPLICATION_UID 10000 -#define LAST_APPLICATION_UID 19999 - - uid_t appid = uid % PER_USER_RANGE; - return appid >= FIRST_APPLICATION_UID && appid <= LAST_APPLICATION_UID; -} - -static inline bool is_unsupported_uid(uid_t uid) -{ -#define LAST_APPLICATION_UID 19999 - uid_t appid = uid % 100000; - return appid > LAST_APPLICATION_UID; -} - int ksu_handle_umount(uid_t old_uid, uid_t new_uid) { struct umount_tw *tw; @@ -196,11 +179,6 @@ int ksu_handle_umount(uid_t old_uid, uid_t new_uid) return 0; } - if (!is_appuid(new_uid) || is_unsupported_uid(new_uid)) { - pr_info("handle setuid ignore non application or isolated uid: %d\n", new_uid); - return 0; - } - if (!ksu_uid_should_umount(new_uid)) { return 0; } else { diff --git a/kernel/setuid_hook.c b/kernel/setuid_hook.c index 346bf7d5..f9ed0e57 100644 --- a/kernel/setuid_hook.c +++ b/kernel/setuid_hook.c @@ -58,8 +58,6 @@ #include "kernel_umount.h" #include "app_profile.h" -#include "sulog.h" - static bool ksu_enhanced_security_enabled = false; static int enhanced_security_feature_get(u64 *value)