mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
Userland: Always call syscall(SC_prctl, ...) with 4 arguments
The arguments are passed on registers, so if we pass only 3 defined arguments then the fourth argument for the prctl syscall could have garbage value within it. To avoid possible bugs, always pass 3 arguments to a raw syscall prctl call in addition to the prctl sub-option (the first argument).
This commit is contained in:
parent
ab4262d49e
commit
2966188ea3
3 changed files with 4 additions and 4 deletions
|
@ -30,7 +30,7 @@ void __assertion_failed(char const* msg)
|
|||
{ "assertion", strlen("assertion") },
|
||||
{ msg, strlen(msg) },
|
||||
};
|
||||
syscall(SC_prctl, PR_SET_COREDUMP_METADATA_VALUE, ¶ms, nullptr);
|
||||
syscall(SC_prctl, PR_SET_COREDUMP_METADATA_VALUE, ¶ms, nullptr, nullptr);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1012,13 +1012,13 @@ void dump_backtrace()
|
|||
|
||||
int get_process_name(char* buffer, int buffer_size)
|
||||
{
|
||||
int rc = syscall(SC_prctl, PR_GET_PROCESS_NAME, buffer, buffer_size);
|
||||
int rc = syscall(SC_prctl, PR_GET_PROCESS_NAME, buffer, buffer_size, nullptr);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int set_process_name(char const* name, size_t name_length)
|
||||
{
|
||||
int rc = syscall(SC_prctl, PR_SET_PROCESS_NAME, name, name_length);
|
||||
int rc = syscall(SC_prctl, PR_SET_PROCESS_NAME, name, name_length, nullptr);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ void ELF::DynamicLinker::linker_main(DeprecatedString&& main_program_path, int m
|
|||
|
||||
s_loaders.clear();
|
||||
|
||||
int rc = syscall(SC_prctl, PR_SET_NO_NEW_SYSCALL_REGION_ANNOTATIONS, 1, 0);
|
||||
int rc = syscall(SC_prctl, PR_SET_NO_NEW_SYSCALL_REGION_ANNOTATIONS, 1, 0, nullptr);
|
||||
if (rc < 0) {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue