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

Error re-mounting chroot in RO #33

Closed
jinroh opened this issue Jul 6, 2017 · 4 comments
Closed

Error re-mounting chroot in RO #33

jinroh opened this issue Jul 6, 2017 · 4 comments

Comments

@jinroh
Copy link

jinroh commented Jul 6, 2017

Starting the following command fail on the re-mount as RO with mountRemountRO():228 mount('/', flags:MS_RDONLY|MS_REMOUNT|MS_NOATIME|0): Operation not permitted:

$ nsjail --chroot / -- /bin/sh -i
[2017-07-06T13:32:26+0000] Mode: STANDALONE_ONCE
[2017-07-06T13:32:26+0000] Jail parameters: hostname:'NSJAIL', chroot:'/', process:'/bin/sh', bind:[::]:0, max_conns_per_ip:0, time_limit:0, personality:0, daemonize:false, clone_newnet:true, clone_newuser:true, clone_newns:true, clone_newpid:true, clone_newipc:true, clonew_newuts:true, clone_newcgroup:false, keep_caps:false, tmpfs_size:4194304, disable_no_new_privs:false
[2017-07-06T13:32:26+0000] Mount point: src:'/' dst:'/' type:'' flags:MS_RDONLY|MS_BIND|MS_REC|0 options:'' isDir:true
[2017-07-06T13:32:26+0000] Mount point: src:'[NULL]' dst:'/proc' type:'proc' flags:MS_RDONLY|0 options:'' isDir:true
[2017-07-06T13:32:26+0000] Uid map: inside_uid:109 outside_uid:109 count:1 newuidmap:false
[2017-07-06T13:32:26+0000] Gid map: inside_gid:117 outside_gid:117 count:1 newgidmap:false
[2017-07-06T13:32:26+0000] [W][1] mountRemountRO():228 mount('/', flags:MS_RDONLY|MS_REMOUNT|MS_NOATIME|0): Operation not permitted
[2017-07-06T13:32:26+0000] PID: 16959 exited with status: 1, (PIDs left: 0)

Changing the mount options from

/dev/dm-0 / ext4 rw,noatime,errors=remount-ro,data=ordered 0 0

to

/dev/dm-0 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0

fixes the issue.

@jinroh
Copy link
Author

jinroh commented Jul 6, 2017

I'm using the v1.4 release btw.

@robertswiecki
Copy link
Collaborator

Hm.. I can confirm that.. straaangeee :). Let me investigate

@robertswiecki
Copy link
Collaborator

Should be fixed with 6ce7e25

@jinroh
Copy link
Author

jinroh commented Jul 6, 2017

mount is picky :). Thanks for quick fix.

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

No branches or pull requests

2 participants