diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 8641a8ed..c6ac7d66 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -232,7 +232,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, // someone wants to be root manager, just check it! // arg3 should be `/data/user//` char param[128]; - if (ksu_strncpy_from_user_nofault(param, arg3, sizeof(param))) { + if (ksu_strncpy_from_user_nofault(param, arg3, sizeof(param)) == -EFAULT) { #ifdef CONFIG_KSU_DEBUG pr_err("become_manager: copy param err\n"); #endif diff --git a/kernel/kernel_compat.h b/kernel/kernel_compat.h index 8e1df0ad..f47f43a5 100644 --- a/kernel/kernel_compat.h +++ b/kernel/kernel_compat.h @@ -11,7 +11,7 @@ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) #define ksu_strncpy_from_user_nofault strncpy_from_unsafe_user #else -#define ksu_strncpy_from_user_nofault strncpy_from_user +#define ksu_strncpy_from_user_nofault probe_kernel_read #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)