From 18e60ededaba7b7329a287e9820e6ba14f28bac9 Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Tue, 4 Nov 2025 09:29:01 +0800 Subject: [PATCH] Reapply: "kernel: Allow to use in Private Space" (#2857) rebase of https://github.com/tiann/KernelSU/commit/0576495b4b719317f70e520213648efee3f90ab2 Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Co-authored-by: weishu --- kernel/core_hook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index ff0cf57f..b6c985ba 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -573,6 +573,11 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old) return 0; } + // if on private space, see if its possibly the manager + if (new_uid.val > 100000 && new_uid.val % 100000 == ksu_get_manager_uid()) { + ksu_set_manager_uid(new_uid.val); + } + if (ksu_get_manager_uid() == new_uid.val) { pr_info("install fd for: %d\n", new_uid.val);