Skip to content

ZTC-3215: Add pause syscall to seccomp SERVICE_BASICS allowlist - #241

Open
OmegaJak wants to merge 2 commits into
cloudflare:mainfrom
OmegaJak:jkruger/ZTC-3215-add-pause-to-allowed-syscalls
Open

ZTC-3215: Add pause syscall to seccomp SERVICE_BASICS allowlist#241
OmegaJak wants to merge 2 commits into
cloudflare:mainfrom
OmegaJak:jkruger/ZTC-3215-add-pause-to-allowed-syscalls

Conversation

@OmegaJak

Copy link
Copy Markdown
Contributor

std::process::exit() has a safeguard 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 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.

@OmegaJak

Copy link
Copy Markdown
Contributor Author

It seems glibc pause is implemented using ppoll instead on aarch64: https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/pause.c.html#31
https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h.html

So I've added the relevant #[cfg] to allow ppoll with those specific arguments on aarch64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants