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

Support recursively read-only (RRO) bind mounts (kernel >= 5.12) #44978

Closed
AkihiroSuda opened this issue Feb 11, 2023 · 3 comments · Fixed by #45278
Closed

Support recursively read-only (RRO) bind mounts (kernel >= 5.12) #44978

AkihiroSuda opened this issue Feb 11, 2023 · 3 comments · Fixed by #45278
Labels
area/security kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/1-design-review

Comments

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Feb 11, 2023

Description

e.g., docker run -v /mnt:/mnt:rro,rprivate to make its submounts such as /mnt/usbstorage to be read-only.
The existing ro mounts should remain non-recursive, for compatibility sake.

The "rro" mount type has been supported by runc >= 1.1, on kernel >= 5.12.

The "rro" mount type has to be used in conjunction with rprivate propagation, in order to avoid accidentally having writable submounts.

So, we should also have:

Related:

Fixes:

@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Feb 11, 2023

kubernetes/enhancements#3858 (comment)

Probably we should have if-possible form like:

  • -v /mnt:/mnt:rro-if-possible,rprivate
  • --mount type=bind,src=/mnt,dest=/mnt,ro,bind-recursivelyreadonly=if-possible,bind-propagation=rslave

@AkihiroSuda
Copy link
Member Author

@thaJeztah PTAL 🙏

@AkihiroSuda
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/1-design-review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant