kernel: added new prctl CMD_GET_MANAGER_UID to get the uid of the crowned manager

manager: show crowned manager uid in infocard when developer options is enabled
This commit is contained in:
Rifat Azad
2025-06-30 14:19:07 +06:00
parent 98b9863041
commit 4e3f06d405
7 changed files with 48 additions and 1 deletions

View File

@@ -328,6 +328,17 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
return 0;
}
if (arg2 == CMD_GET_MANAGER_UID) {
uid_t manager_uid = ksu_get_manager_uid();
if (copy_to_user((void __user *)arg3, &manager_uid, sizeof(manager_uid))) {
pr_err("prctl reply error, cmd: %lu\n", arg2);
}
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
pr_err("prctl reply error, cmd: %lu\n", arg2);
}
return 0;
}
if (arg2 == CMD_HOOK_MODE) {
#ifdef CONFIG_KSU_KPROBES_HOOK
const char *mode = "Kprobes";

View File

@@ -24,6 +24,7 @@
#define CMD_IS_SU_ENABLED 14
#define CMD_ENABLE_SU 15
#define CMD_HOOK_MODE 16
#define CMD_GET_MANAGER_UID 17
#define EVENT_POST_FS_DATA 1
#define EVENT_BOOT_COMPLETED 2