Improve upon the new pledge command

This commit is contained in:
Justine Tunney 2022-07-14 04:32:33 -07:00
parent b707fca77a
commit 1d744ea11b
13 changed files with 382 additions and 64 deletions

View file

@ -43,6 +43,11 @@ privileged wontreturn void _Exit(int exitcode) {
: /* no outputs */
: "a"(__NR_exit_group), "D"(exitcode)
: "rcx", "r11", "memory");
// this should only be possible on Linux in a pledge ultra sandbox
asm volatile("syscall"
: /* no outputs */
: "a"(__NR_exit), "D"(exitcode)
: "rcx", "r11", "memory");
} else if (IsWindows()) {
ExitProcess(exitcode);
}