diff --git a/kernel/kernel_compat.c b/kernel/kernel_compat.c index b6339b59..6e0fe8ad 100644 --- a/kernel/kernel_compat.c +++ b/kernel/kernel_compat.c @@ -8,11 +8,6 @@ #include "klog.h" // IWYU pragma: keep #include "kernel_compat.h" -long ksu_strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr, - long count) -{ - return strncpy_from_user_nofault(dst, unsafe_addr, count); -} #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 2) // Android backport this feature in 5.10.2 struct action_cache { diff --git a/kernel/kernel_compat.h b/kernel/kernel_compat.h index 9e31e235..8b4e1061 100644 --- a/kernel/kernel_compat.h +++ b/kernel/kernel_compat.h @@ -4,10 +4,6 @@ #include #include -extern long ksu_strncpy_from_user_nofault(char *dst, - const void __user *unsafe_addr, - long count); - /* * ksu_copy_from_user_retry * try nofault copy first, if it fails, try with plain diff --git a/kernel/sucompat.c b/kernel/sucompat.c index 87a9dee6..56b0b810 100644 --- a/kernel/sucompat.c +++ b/kernel/sucompat.c @@ -160,7 +160,7 @@ int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, char path[sizeof(su) + 1]; memset(path, 0, sizeof(path)); - ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path)); + strncpy_from_user_nofault(path, *filename_user, sizeof(path)); if (unlikely(!memcmp(path, su, sizeof(su)))) { #if __SULOG_GATE @@ -207,7 +207,7 @@ int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags) pr_info("vfs_statx su->sh!\n"); memcpy((void *)filename->name, sh, sizeof(sh)); #else - ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path)); + strncpy_from_user_nofault(path, *filename_user, sizeof(path)); if (unlikely(!memcmp(path, su, sizeof(su)))) { #if __SULOG_GATE @@ -291,7 +291,7 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user, return 0; memset(path, 0, sizeof(path)); - ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path)); + strncpy_from_user_nofault(path, *filename_user, sizeof(path)); if (likely(memcmp(path, su, sizeof(su)))) return 0;