summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/stdlib.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-05 12:16:30 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-05 12:23:39 +0100
commite87eac92730f1cc55d7a44f8bb6331b4a8e33535 (patch)
treec8a17aba1bf677a5fc6059b018baa8f861fd1670 /Userland/Libraries/LibC/stdlib.cpp
parent4df3a34bc29a4fde57bd0d1ae408a3d094c10b62 (diff)
downloadserenity-e87eac92730f1cc55d7a44f8bb6331b4a8e33535.zip
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.
Diffstat (limited to 'Userland/Libraries/LibC/stdlib.cpp')
-rw-r--r--Userland/Libraries/LibC/stdlib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/stdlib.cpp b/Userland/Libraries/LibC/stdlib.cpp
index 8a0dc247d0..56f1070e76 100644
--- a/Userland/Libraries/LibC/stdlib.cpp
+++ b/Userland/Libraries/LibC/stdlib.cpp
@@ -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)