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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

return ret;
}

ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
Expand Down