1
0
Эх сурвалжийг харах

sys_pipe加入访问安全检查

shaojinchun 5 жил өмнө
parent
commit
52604968e6

+ 5 - 0
components/lwp/lwp_syscall.c

@@ -2662,6 +2662,11 @@ int sys_access(const char *filename, int mode)
 
 
 int sys_pipe(int fd[2])
 int sys_pipe(int fd[2])
 {
 {
+    if (!lwp_user_accessable((void *)fd, sizeof(int[2])))
+    {
+        rt_set_errno(EINVAL);
+        return -1;
+    }
     return pipe(fd);
     return pipe(fd);
 }
 }