diff --git a/kernel/Kconfig b/kernel/Kconfig index ddffdeb7..a24a5b90 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -46,6 +46,12 @@ config KSU_TRACEPOINT_HOOK help If enabled, Hook required KernelSU syscalls with Tracepoint. +config KSU_MANUAL_HOOK + bool "Hook KernelSU manually" + depends on KSU != m + help + If enabled, Hook required KernelSU syscalls with manually-patched function. + endchoice endmenu diff --git a/kernel/Makefile b/kernel/Makefile index b6d93a5c..fb119acd 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -98,6 +98,8 @@ ifeq ($(strip $(CONFIG_KSU_KPROBES_HOOK)),y) $(info -- SukiSU: CONFIG_KSU_KPROBES_HOOK) else ifeq ($(strip $(CONFIG_KSU_TRACEPOINT_HOOK)),y) $(info -- SukiSU: CONFIG_KSU_TRACEPOINT_HOOK) +else ifeq ($(strip $(CONFIG_KSU_MANUAL_HOOK)),y) +$(info -- SukiSU: CONFIG_KSU_MANUAL_HOOK) endif KERNEL_VERSION := $(VERSION).$(PATCHLEVEL) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index ea6f715d..c32f833f 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -544,12 +544,11 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, // Checking hook usage if (arg2 == CMD_HOOK_TYPE) { - const char *hook_type; - -#ifdef CONFIG_KSU_TRACEPOINT_HOOK - hook_type = "Tracepoint"; -#else - hook_type = "Kprobes"; + const char *hook_type = "Kprobes"; +#if defined(CONFIG_KSU_TRACEPOINT_HOOK) + hook_type = "Tracepoint"; +#elif defined(CONFIG_KSU_MANUAL_HOOK) + hook_type = "Manual"; #endif size_t len = strlen(hook_type) + 1;