From abbe385382b615efdf21da94a3895188a2ccf8e7 Mon Sep 17 00:00:00 2001 From: saitama-droid Date: Wed, 8 Oct 2025 03:33:17 -0300 Subject: [PATCH] kernel: core_hook: add config guard for manual SU escalation (#453) Wrap manual SU escalation handling in CONFIG_KSU_MANUAL_SU conditional compilation to allow builds without this functionality. This affects: - CMD_SU_ESCALATION_REQUEST - CMD_ADD_PENDING_ROOT When CONFIG_KSU_MANUAL_SU is disabled, these prctl commands will not be compiled into the kernel. --- kernel/core_hook.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index a495aad3..a519dd57 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -729,6 +729,7 @@ skip_check: return 0; } +#ifdef CONFIG_KSU_MANUAL_SU if (arg2 == CMD_SU_ESCALATION_REQUEST) { uid_t target_uid = (uid_t)arg3; struct su_request_arg __user *user_req = (struct su_request_arg __user *)arg4; @@ -767,6 +768,7 @@ skip_check: pr_err("prctl: CMD_ADD_PENDING_ROOT reply error\n"); return 0; } +#endif // all other cmds are for 'root manager'