summaryrefslogtreecommitdiff
path: root/components/lwp/lwp_syscall.c
diff options
context:
space:
mode:
authorgeniusgogo <[email protected]>2023-07-03 19:25:59 +0800
committerGitHub <[email protected]>2023-07-03 19:25:59 +0800
commit2aa4510aa8a6133ec0fc36200899289f434cc768 (patch)
treec8d75f715b03155fd64c71f11244464b07dd6681 /components/lwp/lwp_syscall.c
parentfd3b4329157a3d57b3e09fd9f95bad925d2c1d2e (diff)
execute elf add executable permissions check. (#7769)
Diffstat (limited to 'components/lwp/lwp_syscall.c')
-rw-r--r--components/lwp/lwp_syscall.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c
index bc9af4d1fa..e89b2db1c0 100644
--- a/components/lwp/lwp_syscall.c
+++ b/components/lwp/lwp_syscall.c
@@ -2246,6 +2246,11 @@ sysret_t sys_execve(const char *path, char *const argv[], char *const envp[])
int i;
struct lwp_args_info args_info;
+ if (access(path, X_OK) != 0)
+ {
+ return -EACCES;
+ }
+
lwp = lwp_self();
thread = rt_thread_self();
uni_thread = 1;