-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rootless bind-mount failure for read-only volume with 1.2.[0-4] #4575
Comments
Is podman setting "rw" explicitly here? If they are just doing "bind" with no additional options then the existing flags should be copied without touching any locked flags. (The change in behaviour was designed to fix some very severe bugs in how we handled clearing flags.) |
No, podman doesn't force a rw. I can reproduce this issue only with /nix/store and therefor I close this issue. |
It took some time to reproduce the issue. It is important that no instance is running when the bind-mount is performed. Following script can reproduce this issue:
The resulting error is: |
Couldn't repro this on my laptop (kernel 6.12.6-200.fc41.x86_64, podman 5.3.1) with either runc 1.2.3 or from git HEAD. In my case it shows:
which, I guess, means the mount was successful. Supposedly something is fixed either in podman or kernel. |
Yes, your output shows a successful mount. I updated my aarch64 system to kernel 6.12.7 and podman 5.3.1 and get still the mount issue. |
Are there any differences in the mounts? Here's mine: [kir@kir-tp1 runc]$ grep /tmp /proc/self/mountinfo
50 77 0:46 / /tmp rw,nosuid,nodev shared:83 - tmpfs tmpfs rw,seclabel,size=32766188k,nr_inodes=1048576,inode64
1112 50 0:46 /test-ro-volume /tmp/test-ro-volume ro,nosuid,nodev shared:83 - tmpfs tmpfs rw,seclabel,size=32766188k,nr_inodes=1048576,inode64 |
Yes, I have no tmpfs mounted at /tmp. My /tmp is part of /: |
I changed my system to use tmpfs for /tmp: But the mount still failes: |
Description
Since runc version 1.2 the bind-mount of a read-only volume fails. A strace shows, that a MS_REMOUNT is performed, which failes. MS_REMOUNT was introduced with #3967
The issue raised during updating NixOS from runc version 1.1.15 to 1.2.2, see NixOS/nixpkgs#353610
When volume option ro is given, then the bind mount works as expected.
Steps to reproduce the issue
Describe the results you received and expected
workaround:
$ podman run --runtime=runc -d --name=sleeping -v /nix/store:/bin:ro scratchimg /bin/sleep 10
What version of runc are you using?
1.2.3
Host OS information
Host kernel information
Linux prl 6.6.68 #1-NixOS SMP Fri Dec 27 12:58:58 UTC 2024 aarch64 GNU/Linux
The text was updated successfully, but these errors were encountered: