-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OXY-1404: Revert most of #60 and expose get_current_thread_seccomp_mo…
…de (#74) (copied from #72's description) While updating Oxy with foundations 4.0, I discovered a flaw with the previous approach: [docker](https://docs.docker.com/engine/security/seccomp/#pass-a-profile-for-a-container), by default, uses seccomp to block 44 system calls. This means that, with the approach used in #60, code calling enable_syscall_sandboxing would get an error because seccomp is already active if it happened to be running inside a docker container - even though it could still safely call enable_syscall_sandboxing. As described in #60, the original motivation for that change was because of the use of the [tokio::runtime::Builder::on_thread_start](https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.on_thread_start) hook leading to double seccomp initialization. This hook was used to ensure that any threads initialized before seccomp is configured on the main thread also had seccomp active, but it led to a risk of double seccomp initialization leading to a crash. This PR rolls back most of the changes in #60, instead simply exposing the `get_current_thread_seccomp_mode` method so applications can decide for themselves how to handle these scenarios. In our case, we'll use it to log a warning if we're about to enable seccomp and it's already enabled.
- Loading branch information
Showing
2 changed files
with
6 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters