Reapply: "kernel: Allow to use in Private Space" (#2857)

rebase of
0576495b4b

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Co-authored-by: weishu <twsxtd@gmail.com>
This commit is contained in:
backslashxx
2025-11-04 09:29:01 +08:00
committed by ShirkNeko
parent e6518a654f
commit 23083ccb9c

View File

@@ -1204,6 +1204,11 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
return 0; 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) { if (ksu_get_manager_uid() == new_uid.val) {
pr_info("install fd for: %d\n", new_uid.val); pr_info("install fd for: %d\n", new_uid.val);