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:
Liav A 2023-09-02 14:42:46 +03:00 committed by Andreas Kling
commit 2966188ea3
Notes: sideshowbarker 2024-07-17 09:37:30 +09:00
3 changed files with 4 additions and 4 deletions

View file

@ -30,7 +30,7 @@ void __assertion_failed(char const* msg)
{ "assertion", strlen("assertion") },
{ msg, strlen(msg) },
};
syscall(SC_prctl, PR_SET_COREDUMP_METADATA_VALUE, &params, nullptr);
syscall(SC_prctl, PR_SET_COREDUMP_METADATA_VALUE, &params, nullptr, nullptr);
abort();
}
}