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

don't return if remount of "/" fails in create_sandbox #163

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

rohrschacht
Copy link
Contributor

This fixes issue #161.
By not returning from create_sandbox() when the remount of "/" fails, slirp4netns continues to operate normally instead of exiting.
I tested this setup for a few days and it seems to work fine.

@AkihiroSuda
Copy link
Member

Thanks, could you sign the commit with git commit -s with your full name?

@@ -135,7 +135,6 @@ int create_sandbox()
ret = mount("tmpfs", "/", "tmpfs", MS_REMOUNT | MS_RDONLY, "size=0k");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giuseppe Why do we need this tmpfs, and why does it fail?

Copy link
Member

@AkihiroSuda AkihiroSuda Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was it expected to mount tmpfs on /tmp, not /?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "tmpfs" here is just ignored, the goal is to remount the entire root as read only. We didn't manage to find the reason why it fails in the @rohrschacht use case

@@ -135,7 +135,6 @@ int create_sandbox()
ret = mount("tmpfs", "/", "tmpfs", MS_REMOUNT | MS_RDONLY, "size=0k");
if (ret < 0) {
fprintf(stderr, "cannot mount tmpfs on /tmp\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't seem /tmp?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the error message is wrong here it should mention "cannot remount / as read-only"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could add another commit to the PR that changes the error message, if you'd like

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo is fixed in #170

@rohrschacht
Copy link
Contributor Author

Thanks, could you sign the commit with git commit -s with your full name?

I signed the commit locally via rebase, but I can't push it to github without force-push. Would this break the PR?

@AkihiroSuda
Copy link
Member

force-push is fine

@AkihiroSuda
Copy link
Member

Please include SIgned-off-by line in the commit message. (git commit -a -s --amend)

@AkihiroSuda
Copy link
Member

@AkihiroSuda
Copy link
Member

@giuseppe Do you think we can merge this, or is it better to find out the cause of the issue?

@giuseppe
Copy link
Collaborator

@giuseppe Do you think we can merge this, or is it better to find out the cause of the issue?

I think we can merge it if we ever find the root cause we can revert it, not having the rootfs is still a tmpfs so it is still safe.

@AkihiroSuda AkihiroSuda merged commit e6b31fe into rootless-containers:master Dec 18, 2019
AkihiroSuda added a commit to AkihiroSuda/slirp4netns that referenced this pull request Dec 18, 2019
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