From 37300fefd4f95b598449b69648346fa4c04960b2 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Mon, 13 Oct 2025 15:37:35 +0800 Subject: [PATCH] kernel: Remove susfs status retrieval --- kernel/core_hook.c | 24 ----------------------- kernel/ksu.h | 49 ---------------------------------------------- 2 files changed, 73 deletions(-) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 33e4a3e6..6ddf6092 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -863,30 +863,6 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, return 0; } - // Get SUSFS function status - if (arg2 == CMD_GET_SUSFS_FEATURE_STATUS) { - struct susfs_feature_status status; - - if (!ksu_access_ok((void __user*)arg3, sizeof(status))) { - pr_err("susfs_feature_status: arg3 is not accessible\n"); - return 0; - } - - init_susfs_feature_status(&status); - - if (copy_to_user((void __user*)arg3, &status, sizeof(status))) { - pr_err("susfs_feature_status: copy_to_user failed\n"); - return 0; - } - - if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { - pr_err("susfs_feature_status: prctl reply error\n"); - } - - pr_info("susfs_feature_status: successfully returned feature status\n"); - return 0; - } - #ifdef CONFIG_KSU_MANUAL_SU if (arg2 == CMD_SU_ESCALATION_REQUEST) { uid_t target_uid = (uid_t)arg3; diff --git a/kernel/ksu.h b/kernel/ksu.h index cdf3cb15..1c6780a3 100644 --- a/kernel/ksu.h +++ b/kernel/ksu.h @@ -33,7 +33,6 @@ #define CMD_ENABLE_KPM 100 #define CMD_HOOK_TYPE 101 -#define CMD_GET_SUSFS_FEATURE_STATUS 102 #define CMD_DYNAMIC_MANAGER 103 #define CMD_GET_MANAGERS 104 #define CMD_ENABLE_UID_SCANNER 105 @@ -72,54 +71,6 @@ struct manager_list_info { } managers[2]; }; -// SUSFS Functional State Structures -struct susfs_feature_status { - bool status_sus_path; - bool status_sus_mount; - bool status_auto_default_mount; - bool status_auto_bind_mount; - bool status_sus_kstat; - bool status_try_umount; - bool status_auto_try_umount_bind; - bool status_spoof_uname; - bool status_enable_log; - bool status_hide_symbols; - bool status_spoof_cmdline; - bool status_open_redirect; - bool status_magic_mount; - bool status_sus_su; -}; - -struct susfs_config_map { - bool *status_field; - bool is_enabled; -}; - -#define SUSFS_FEATURE_CHECK(config, field) \ - do { \ - status->field = IS_ENABLED(config); \ - } while(0) - -static inline void init_susfs_feature_status(struct susfs_feature_status *status) -{ - memset(status, 0, sizeof(*status)); - - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SUS_PATH, status_sus_path); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SUS_MOUNT, status_sus_mount); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT, status_auto_default_mount); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT, status_auto_bind_mount); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SUS_KSTAT, status_sus_kstat); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_TRY_UMOUNT, status_try_umount); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT, status_auto_try_umount_bind); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SPOOF_UNAME, status_spoof_uname); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_ENABLE_LOG, status_enable_log); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS, status_hide_symbols); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG, status_spoof_cmdline); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_OPEN_REDIRECT, status_open_redirect); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT, status_magic_mount); - SUSFS_FEATURE_CHECK(CONFIG_KSU_SUSFS_SUS_SU, status_sus_su); -} - struct root_profile { int32_t uid; int32_t gid;