From 0576495b4b719317f70e520213648efee3f90ab2 Mon Sep 17 00:00:00 2001 From: weishu Date: Thu, 16 May 2024 12:03:50 +0800 Subject: [PATCH] kernel: Allow to use in Private Space --- kernel/core_hook.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 71265736d50c..429ba3306ea3 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -219,6 +219,14 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, return 0; } + // TODO: find it in throne tracker! + uid_t current_uid_val = current_uid().val; + uid_t manager_uid = ksu_get_manager_uid(); + if (current_uid_val != manager_uid && + current_uid_val % 100000 == manager_uid) { + ksu_set_manager_uid(current_uid_val); + } + bool from_root = 0 == current_uid().val; bool from_manager = is_manager();