Kernel: All syscalls now validate users pointers

We now validate pointers passed by the user, to forbid arbitary
memory read/write. Now the user is only allowed to pass in pointers
in their own mapped memory space (or null).
This commit is contained in:
2023-09-25 22:07:12 +03:00
parent 976114fde1
commit 22252cfcf0
5 changed files with 144 additions and 39 deletions

View File

@@ -188,7 +188,7 @@ namespace Kernel
ret = Process::current().sys_sync();
break;
case SYS_MMAP:
ret = Process::current().sys_mmap(*(const sys_mmap_t*)arg1);
ret = Process::current().sys_mmap((const sys_mmap_t*)arg1);
break;
case SYS_MUNMAP:
ret = Process::current().sys_munmap((void*)arg1, (size_t)arg2);