Try to solve 4.14 build don't pass problem (#368)

This commit is contained in:
chen2021-web
2023-04-11 23:13:34 +08:00
committed by GitHub
parent 273a0b0b99
commit a343aa5eb0

View File

@@ -166,10 +166,12 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
if (p && !IS_ERR(p)) { if (p && !IS_ERR(p)) {
char first_arg[16]; char first_arg[16];
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
strncpy_from_user_nofault(first_arg, p, sizeof(first_arg)); strncpy_from_user_nofault(first_arg, p, sizeof(first_arg));
#else #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
strncpy_from_unsafe_user(first_arg, p, sizeof(first_arg)); strncpy_from_unsafe_user(first_arg, p, sizeof(first_arg));
#endif #else
strncpy_from_user(first_arg, p, sizeof(first_arg));
#endif
pr_info("first arg: %s\n", first_arg); pr_info("first arg: %s\n", first_arg);
if (!strcmp(first_arg, "second_stage")) { if (!strcmp(first_arg, "second_stage")) {
pr_info("/system/bin/init second_stage executed\n"); pr_info("/system/bin/init second_stage executed\n");