-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate runtime components into single runtime #290
Conversation
One wart here is that we use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as is the usage for this is to add the ia2-main
library which wraps main to fork and run the binary? How does this interact with our existing wrapping of main to set the pkey?
Did you decide to do this rather than the external binary that runs a separate child with fork+exec? Or was this implementation before we discussed that?
/* track the inferior process' memory map. | ||
|
||
returns true if the inferior exits, false on trace error. | ||
|
||
if true is returned, the inferior's exit status will be stored to *exit_status_out if not NULL. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want to put this in the header?
3c7d8f1
to
8f99d07
Compare
the latter only kills one thread which is really never what you want
this produces a binary `ia2-sandbox` that wraps the execution of its arguments
in ptrace mode we run the child to the next syscall entry/exit, while in seccomp mode we run until our seccomp policy causes a stop this means we should never see extraneous stops in seccomp mode; we now check this
these are needed to gracefully handle the case of exec() of the child failing
8f99d07
to
5abc742
Compare
This is without the changes needed to support multiple threads and fork/exec; see #307. |
This is not yet applied to our compartmentalized binaries and tests, but runs a tiny (uncompartmentalized) demo program I've been linking against it manually for validation.
This PR will be ready for merging when the build-system work is done to integrate the runtime with our tests themselves, but we'll want a switch to build without the runtime (or disable it) so that we can debug tests, as the runtime (being a
ptrace
r) conflicts with gdb and other debuggers.This implements an initial coarse-grained syscall policy very similar to that described in #233, and integrates fine-grained syscall filtering as described in #235. As we validate this on our tests/demons/nginx we'll probably add syscalls to our allowlist to get closer to what #231 outlines.