From beaa048be33df322a6132d3af50504ac132720ec Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 9 Aug 2023 12:33:05 +0800 Subject: [PATCH] kernel: don't trigger page fault when become manager. fix #836 --- kernel/core_hook.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 83413b47..8641a8ed 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -232,8 +232,10 @@ 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 (copy_from_user(param, arg3, sizeof(param))) { + if (ksu_strncpy_from_user_nofault(param, arg3, sizeof(param))) { +#ifdef CONFIG_KSU_DEBUG pr_err("become_manager: copy param err\n"); +#endif return 0; }