kernel: add better error message if CMD_GET_MANAGWR_UID fails to fetch manager_uid

This commit is contained in:
Rifat Azad
2025-07-11 04:11:17 +06:00
committed by GitHub
parent 3ba5b028d4
commit b567e9b275

View File

@@ -329,15 +329,15 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
} }
if (arg2 == CMD_GET_MANAGER_UID) { if (arg2 == CMD_GET_MANAGER_UID) {
uid_t manager_uid = ksu_get_manager_uid(); uid_t manager_uid = ksu_get_manager_uid();
if (copy_to_user((void __user *)arg3, &manager_uid, sizeof(manager_uid))) { if (copy_to_user(arg3, &manager_uid, sizeof(manager_uid))) {
pr_err("prctl reply error, cmd: %lu\n", arg2); pr_err("get manager uid failed\n");
} }
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
pr_err("prctl reply error, cmd: %lu\n", arg2); pr_err("prctl reply error, cmd: %lu\n", arg2);
} }
return 0; return 0;
} }
if (arg2 == CMD_HOOK_MODE) { if (arg2 == CMD_HOOK_MODE) {
#ifdef CONFIG_KSU_KPROBES_HOOK #ifdef CONFIG_KSU_KPROBES_HOOK