Userland: Add LibSystem and funnel all syscalls through it

This achieves two things:

- Programs can now intentionally perform arbitrary syscalls by calling
  syscall(). This allows us to work on things like syscall fuzzing.

- It restricts the ability of userspace to make syscalls to a single
  4KB page of code. In order to call the kernel directly, an attacker
  must now locate this page and call through it.
This commit is contained in:
Andreas Kling 2021-02-05 12:16:30 +01:00
commit e87eac9273
Notes: sideshowbarker 2024-07-18 22:34:58 +09:00
47 changed files with 164 additions and 47 deletions

View file

@ -30,7 +30,6 @@
#include <AK/StdLibExtras.h>
#include <AK/Types.h>
#include <AK/Utf8View.h>
#include <Kernel/API/Syscall.h>
#include <LibELF/AuxiliaryVector.h>
#include <alloca.h>
#include <assert.h>
@ -45,6 +44,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <syscall.h>
#include <unistd.h>
static void strtons(const char* str, char** endptr)