kernel: Fix manager recognize err

This commit is contained in:
weishu
2023-08-09 16:28:22 +08:00
parent 7ecb4b03ee
commit cde3e95180
2 changed files with 2 additions and 2 deletions

View File

@@ -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/<userId>/<manager_package_name>`
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

View File

@@ -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)