1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:17:44 +00:00

Kernel: Enable SMAP protection during the execve() syscall

The userspace execve() wrapper now measures all the strings and puts
them in a neat and tidy structure on the stack.

This way we know exactly how much to copy in the kernel, and we don't
have to use the SMAP-violating validate_read_str(). :^)
This commit is contained in:
Andreas Kling 2020-01-10 12:20:36 +01:00
parent bf9f36bf22
commit 952bb95baa
4 changed files with 78 additions and 38 deletions

View file

@ -300,6 +300,22 @@ struct SC_set_mmap_name_params {
size_t name_length;
};
struct SyscallString {
const char* characters { nullptr };
size_t length { 0 };
};
struct SyscallStringList {
SyscallString* strings { nullptr };
size_t length { 0 };
};
struct SC_execve_params {
SyscallString path;
SyscallStringList arguments;
SyscallStringList environment;
};
void initialize();
int sync();