From 2ba57e55053ef824379e278e6054c2e8465ced62 Mon Sep 17 00:00:00 2001 From: hw_llm Date: Fri, 23 Aug 2024 10:27:18 +0800 Subject: [PATCH] =?UTF-8?q?cherry=20pick=20a058649=20from=20https://gitee.?= =?UTF-8?q?com/hw=5Fllm/kernel=5Fliteos=5Fa/pulls/1215=20Description:=20sy?= =?UTF-8?q?scall=20SysExecve=20=E6=89=A7=E8=A1=8C=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20IssueNo:=20https://gitee.com/openharmony/k?= =?UTF-8?q?ernel=5Fliteos=5Fa/issues/IALXZ5=20Feature=20Or=20Bugfix:=20Bug?= =?UTF-8?q?fix=20Binary=20Source:=20No=20Signed-off-by:=20hw=5Fllm=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- syscall/fs_syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index eec9b5b4..d680cb22 100644 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -641,6 +641,9 @@ OUT: #ifdef LOSCFG_KERNEL_DYNLOAD int SysExecve(const char *fileName, char *const *argv, char *const *envp) { + if (!LOS_IsUserAddress((vaddr_t)(UINTPTR)fileName)) { + return -EFAULT; + } return LOS_DoExecveFile(fileName, argv, envp); } #endif