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.
This commit is contained in:
saitama-droid
2025-10-08 03:33:17 -03:00
committed by GitHub
parent 0b80137f17
commit abbe385382

View File

@@ -729,6 +729,7 @@ skip_check:
return 0; return 0;
} }
#ifdef CONFIG_KSU_MANUAL_SU
if (arg2 == CMD_SU_ESCALATION_REQUEST) { if (arg2 == CMD_SU_ESCALATION_REQUEST) {
uid_t target_uid = (uid_t)arg3; uid_t target_uid = (uid_t)arg3;
struct su_request_arg __user *user_req = (struct su_request_arg __user *)arg4; 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"); pr_err("prctl: CMD_ADD_PENDING_ROOT reply error\n");
return 0; return 0;
} }
#endif
// all other cmds are for 'root manager' // all other cmds are for 'root manager'