소스 검색

Kernel: Make sys$msyscall() EFAULT on non-user address

Fixes #5361.
Andreas Kling 4 년 전
부모
커밋
575c7ed414
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Kernel/Syscalls/mmap.cpp

+ 3 - 0
Kernel/Syscalls/mmap.cpp

@@ -563,6 +563,9 @@ int Process::sys$msyscall(void* address)
         return 0;
     }
 
+    if (!is_user_address(VirtualAddress { address }))
+        return -EFAULT;
+
     auto* region = space().find_region_containing(Range { VirtualAddress { address }, 1 });
     if (!region)
         return -EINVAL;