Skip to content
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

Use a sandbox with mkcomposefs --from-file #221

Closed
wants to merge 4 commits into from

Conversation

alexlarsson
Copy link
Collaborator

This is for similar reasons as it being used with composefs-from-json.

This will help with reuse.

Signed-off-by: Alexander Larsson <[email protected]>
This helps protecting the parsing code if some external process
is feeding data to mkcomposefs to create an image.

Its not really useful to use a sandbox when a directory is specified
though, as it needs to do way to many different kinds of operations,
as well as reading actual uid/gid:s etc.

Signed-off-by: Alexander Larsson <[email protected]>
Add some extra syscalls that are used on other arches:
 fstate: fstat64
 newfstatat: fstatat64
 mmap: mmap2

Signed-off-by: Alexander Larsson <[email protected]>
@alexlarsson
Copy link
Collaborator Author

==5399==Can't open /proc/5384/task for reading.
==5384==LeakSanitizer has encountered a fatal error.

I wonder if we need to add a /proc to the sandbox. That should be relatively safe.

@cgwalters
Copy link
Contributor

I'm not opposed to this but I find it strange...I think most sandboxing like this is much better done externally. I mean we're talking about having this code be run from a thing that's a container runtime already.

@alexlarsson
Copy link
Collaborator Author

I'm not opposed to this but I find it strange...I think most sandboxing like this is much better done externally. I mean we're talking about having this code be run from a thing that's a container runtime already.

It is somewhat uncommon, but not totally. Its more like the openbsd pledge thing, where you do some setup, including opening all fd:s that you need, and then limit yourself for the actual work. For example, we run the parser code without any access to the open/creat syscalls, which isn't really possible to do from the caller, as we need to open things in the ssetup.

That said, maybe it does overcomplicate things... For example with the CI failure...

@alexlarsson alexlarsson marked this pull request as draft October 13, 2023 12:22
@alexlarsson
Copy link
Collaborator Author

closing this for now, not sure its right

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.

2 participants