Skip to content

Commit 305605a

Browse files
authored
Merge pull request #1222 from cyphar/idmap-flag
config: add idmap and ridmap mount options
2 parents 4fec88f + 7b8eb69 commit 305605a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

config.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ Runtimes MUST/SHOULD/MAY implement the following option strings for Linux:
146146
`sync` | MUST | [^1]
147147
`tmpcopyup` | MAY | copy up the contents to a tmpfs
148148
`unbindable` | MUST | [^2] (bind mounts)
149+
`idmap` | SHOULD | Indicates that the mount has `uidMappings` and `gidMappings` specified. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If supported, the runtime MUST return an error if this option is provided and either of `uidMappings` or `gidMappings` are empty or not present.
150+
`ridmap` | SHOULD | Indicates that the mount has `uidMappings` and `gidMappings` specified, and the mapping is applied recursively [^3]. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If supported, the runtime MUST return an error if this option is provided and either of `uidMappings` or `gidMappings` are empty or not present.
149151

150152
[^1]: Corresponds to [`mount(8)` (filesystem-independent)][mount.8-filesystem-independent].
151153
[^2]: Corresponds to [`mount(8)` (filesystem-specific)][mount.8-filesystem-specific].
@@ -177,10 +179,16 @@ For POSIX platforms the `mounts` structure has the following fields:
177179
* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted.
178180
* Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*).
179181
* Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m].
180-
* **`uidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert UIDs from the source file system to the destination mount point.\
181-
The format is the same as [user namespace mappings](config-linux.md#user-namespace-mappings).
182+
* **`uidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert UIDs from the source file system to the destination mount point.
183+
This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
184+
If specified, the `options` field of the `mounts` structure SHOULD contain either `idmap` or `ridmap` to specify whether the mapping should be applied recursively for `rbind` mounts, as well as to ensure that older runtimes will not silently ignore this field.
185+
The format is the same as [user namespace mappings](config-linux.md#user-namespace-mappings).
186+
If specified, it MUST be specified along with `gidMappings`.
182187
* **`gidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert GIDs from the source file system to the destination mount point.
183-
For more details see `uidMappings`.
188+
This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
189+
If specified, the `options` field of the `mounts` structure SHOULD contain either `idmap` or `ridmap` to specify whether the mapping should be applied recursively for `rbind` mounts, as well as to ensure that older runtimes will not silently ignore this field.
190+
For more details see `uidMappings`.
191+
If specified, it MUST be specified along with `uidMappings`.
184192

185193

186194
### Example (Linux)

0 commit comments

Comments
 (0)