kernel: added CMD_HOOK_MODE prctl to get the enabled su hook mode value

This commit is contained in:
rifsxd
2025-05-21 17:19:59 +06:00
parent 3b1d5f15f4
commit ce37e17c87
6 changed files with 42 additions and 0 deletions

View File

@@ -339,6 +339,18 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
return 0;
}
if (arg2 == CMD_HOOK_MODE) {
#ifdef CONFIG_KSU_KPROBES_HOOK
const char *mode = "Kprobes";
#else
const char *mode = "Manual";
#endif
if (copy_to_user((void __user *)arg3, mode, strlen(mode) + 1)) {
pr_info("hook: copy_to_user() failed\n");
}
return 0;
}
if (arg2 == CMD_REPORT_EVENT) {
if (!from_root) {
return 0;