Commit 32623da
authored
Add pause syscall to seccomp SERVICE_BASICS allowlist (#241)
`std::process::exit()` has a
[safeguard](https://github.com/rust-lang/rust/blob/fc0f51f5ca44d4586b0e309181382608cd6a8441/library/std/src/sys/exit.rs#L53)
on linux against `libc::exit` thread unsafety which will pause a thread
if it tried to exit simultaneously with another thread. This pause uses
the [pause](https://man7.org/linux/man-pages/man2/pause.2.html) syscall.
If this race condition is triggered with the default seccomp
configuration, the process will be killed by seccomp. This has been
observed in a production environment.
This PR adds the `pause` syscall to the default seccomp allowlist to
avoid this issue.
I don't think this poses any meaningful additional security risk by
allowing potential malicious code to invoke it - at most, it can suspend
a thread indefinitely, which I believe could already be accomplished
with the `futex` syscall, which is already in the `RUST_BASICS`
allowlist.1 parent 36c2b78 commit 32623da
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
0 commit comments