-
Notifications
You must be signed in to change notification settings - Fork 611
Support mount_setattr(2) attributes (mostly for recursively-readonly mounts) #1090
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,6 +139,41 @@ For POSIX platforms the `mounts` structure has the following fields: | |
| ] | ||
| ``` | ||
|
|
||
| ### <a name="configLinuxMounts" />Linux Mounts | ||
|
|
||
| For Linux, the `mounts` structure mounts MAY have the following additional fields: | ||
|
|
||
| * **`attr`** (object, OPTIONAL) specifies `mount_setattr(2)` attributes. Requires kernel 5.12 or later. | ||
| The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface. | ||
| * **`flags`** (array of strings, OPTIONAL) specifies the `flags` argument of `mount_setattr(2)` syscall. | ||
| e.g., "AT_RECURSIVE" | ||
| * **`attr_set`** (array of strings, OPTIONAL) specifies the `attr_set` field of `mount_attr` struct. | ||
| e.g., "MOUNT_ATTR_RDONLY" | ||
| * **`attr_clr`** (array of strings, OPTIONAL) specifies the `attr_clr` field of `mount_attr` struct. | ||
| * **`propagation`** (string, OPTIONAL) specifies the `propagation` field of `mount_attr` struct. | ||
| See [Rootfs Mount Propagation](./config-linux.md#configLinuxRootfsMountPropagation) for the string format. | ||
|
|
||
| <!-- TODO: consider supporting mount_attr.userns_fd --> | ||
|
|
||
| ### Example | ||
|
|
||
| ```json | ||
| "mounts": [ | ||
| { | ||
| "destination": "/ro", | ||
| "type": "none", | ||
| "source": "/volumes/ro", | ||
| "options": ["rbind"], | ||
| "attr": { | ||
| "flags": ["AT_RECURSIVE"], | ||
| "attr_set": ["MOUNT_ATTR_RDONLY"], | ||
| "attr_clr": ["MOUNT_ATTR_NOEXEC"], | ||
| "propagation": "private" | ||
| } | ||
|
Comment on lines
+167
to
+172
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit concerned about how this is just a 1:1 mapping of It makes it a bit confusing in some areas, e.g.,
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think this is going to be recursively-readonly only, though we can prioritize recursively-readonly over other potential usecases
|
||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ## <a name="configProcess" />Process | ||
|
|
||
| **`process`** (object, OPTIONAL) specifies the container process. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.