1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

Kernel+Userland: Refine preventing syscall annotations of Regions option

Instead of using a special case of the annotate_mapping syscall, let's
introduce a new prctl option to disallow further annotations of Regions
as new syscall Region(s).
This commit is contained in:
Liav A 2023-01-20 00:37:14 +02:00 committed by Linus Groh
parent 08de5abc6d
commit b27f88f61d
4 changed files with 23 additions and 6 deletions

View file

@ -17,6 +17,7 @@
#include <AK/ScopeGuard.h>
#include <AK/Vector.h>
#include <Kernel/API/VirtualMemoryAnnotations.h>
#include <Kernel/API/prctl_numbers.h>
#include <LibC/bits/pthread_integration.h>
#include <LibC/link.h>
#include <LibC/sys/mman.h>
@ -677,7 +678,7 @@ void ELF::DynamicLinker::linker_main(DeprecatedString&& main_program_path, int m
s_loaders.clear();
int rc = syscall(SC_annotate_mapping, nullptr);
int rc = syscall(SC_prctl, PR_SET_NO_NEW_SYSCALL_REGION_ANNOTATIONS, 1, 0);
if (rc < 0) {
VERIFY_NOT_REACHED();
}