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

Configure the network namespace before executing jailer #489

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

protochron
Copy link

Right now there is a bug when trying to start a Firecracker VM with jailer using a CNI where the VM is never joined to the correct network namespace. This is because in its current form, the CNI execution occurs when fcinit.SetupNetwork runs, which occurs after the jailer has already created a chroot and dropped privleges.

This fixes the problem by executing the fcinit.SetupNetwork call before running jailer and removing that hook from the FcInit functions later on. It also passes through the UID and GID options to the tc-redirect-tap plugin and includes the IgnoreUnknown directive so that chained CNI plugins work.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@protochron protochron requested a review from a team as a code owner March 28, 2023 18:33
@protochron protochron force-pushed the jailer_cni_network branch 2 times, most recently from 99ec273 to 4c36613 Compare March 28, 2023 18:44
@protochron
Copy link
Author

Not quite sure why the root tests would fail on different architectures 🤔

Right now there is a bug when trying to start a Firecracker VM with
jailer using a CNI where the VM is never joined to the correct network
namespace. This is because in its current form, the CNI execution occurs
when `fcinit.SetupNetwork` runs, which occurs _after_ the jailer has
already created a chroot and dropped privleges.

This fixes the problem by executing the `fcinit.SetupNetwork` call
_before_ running jailer and removing that hook from the `FcInit`
functions later on. It also passes through the UID and GID options to
the `tc-redirect-tap` plugin and includes the `IgnoreUnknown` directive
so that chained CNI plugins work.

Signed-off-by: Dan Norris <[email protected]>
@protochron protochron force-pushed the jailer_cni_network branch 2 times, most recently from 8bd0685 to 88b0352 Compare September 22, 2023 23:32
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.

1 participant