Skip to content

Commit b644395

Browse files
committed
config-linux: RFC 2119 tightening for namespaces
Previously we had no MUST-level runtime requirements for namespace entries in valid configs. This commit attempts to pin those down. I think we want more wording about new namespace creation (what namespace is the seed/parent? Which user namespace owns a runtime namespace? For more background on hierarchical namespaces, see [1]. For more background on the owning user namespace idea, see [2,3,4]), but that wording proved contentious [5,6], so I punted it to [7]. The "'path' not associated with a namespace of type 'type'" condition ensures that runtimes don't blindly call setns(2) on the path without setting nstype nonzero. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a7306ed8d94af729ecef8b6e37506a1c6fc14788 nsfs: add ioctl to get a parent namespace, 2016-09-06 [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6786741dbf99e44fb0c0ed85a37582b8a26f1c3b nsfs: add ioctl to get owning user namespace for ns file descriptor, 2016-09-06 [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5ff5ce6e20ee22511398bb31fb912466cf82a36 nsfs: Add an ioctl() to return the namespace type, 2017-01-25 [4]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d95fa3c76a66b6d76b1e109ea505c55e66360f3c nsfs: Add an ioctl() to return owner UID of a userns, 2017-01-25 [5]: #767 (comment) [6]: #767 (comment) [7]: #795 Signed-off-by: W. Trevor King <[email protected]>
1 parent 5a39b39 commit b644395

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

config-linux.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ The following parameters can be specified to setup namespaces:
3535
* **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container.
3636
* **`cgroup`** the container will have an isolated view of the cgroup hierarchy.
3737

38-
* **`path`** *(string, OPTIONAL)* - an absolute path to namespace file in the [runtime mount namespace](glossary.md#runtime-namespace)
38+
* **`path`** *(string, OPTIONAL)* - an absolute path to namespace file in the [runtime mount namespace](glossary.md#runtime-namespace).
39+
The runtime MUST place the container process in the namespace associated with that `path`.
40+
The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`.
41+
42+
If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`.
3943

40-
If a path is specified, that particular file is used to join that type of namespace.
4144
If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type.
42-
If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST error out.
45+
If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors).
4346

4447
###### Example
4548

0 commit comments

Comments
 (0)