From a343aa5eb0cb139c6bc13a1ab5f98fef781e718c Mon Sep 17 00:00:00 2001 From: chen2021-web <83762621+chen2021-web@users.noreply.github.com> Date: Tue, 11 Apr 2023 23:13:34 +0800 Subject: [PATCH] Try to solve 4.14 build don't pass problem (#368) --- kernel/ksud.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/ksud.c b/kernel/ksud.c index e16f4a24..8199710a 100644 --- a/kernel/ksud.c +++ b/kernel/ksud.c @@ -166,10 +166,12 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr, if (p && !IS_ERR(p)) { char first_arg[16]; #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) - strncpy_from_user_nofault(first_arg, p, sizeof(first_arg)); - #else - strncpy_from_unsafe_user(first_arg, p, sizeof(first_arg)); - #endif + strncpy_from_user_nofault(first_arg, p, sizeof(first_arg)); + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) + strncpy_from_unsafe_user(first_arg, p, sizeof(first_arg)); + #else + strncpy_from_user(first_arg, p, sizeof(first_arg)); + #endif pr_info("first arg: %s\n", first_arg); if (!strcmp(first_arg, "second_stage")) { pr_info("/system/bin/init second_stage executed\n");