Skip to content

Commit 3565df5

Browse files
committed
config-linux: Clarify where device nodes can be created
Clarify that device nodes need not be under `/dev`, but that the runtimes need to be informed of all the device nodes that are used by the container. Virtual-machine based runtimes such as Kata Containers need to be able to perform adjustment on device nodes, and cannot be required to deep-scan file-systems to do so. The proposed wording was chosen to avoid any regression for any workload mounding nodes elsewhere, while at the same time clarifying that correct behaviour cannot be guaranteed if a device node is created on the host and used by the container without being passed in the devices list. This fixes issue #1147. Signed-off-by: Christophe de Dinechin <[email protected]>
1 parent 9ee22ab commit 3565df5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

config-linux.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Each entry has the following structure:
118118
More info in [mknod(1)][mknod.1].
119119
* **`path`** *(string, REQUIRED)* - full path to device inside container.
120120
If a [file][] already exists at `path` that does not match the requested device, the runtime MUST generate an error.
121+
The path MAY be anywhere in the container filesystem, notably outside of `/dev`.
121122
* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device.
122123
* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device.
123124
You can also control access to devices [with cgroups](#configLinuxDeviceAllowedlist).
@@ -126,6 +127,14 @@ Each entry has the following structure:
126127

127128
The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices.
128129

130+
Containers MAY NOT access any device node that is not either explicitly
131+
referenced in the **`devices`** array or listed as being part of the
132+
[default devices](#configLinuxDefaultDevices).
133+
Rationale: runtimes based on virtual machines need to be able to adjust the node
134+
devices, and accessing device nodes that were not adjusted could have undefined
135+
behaviour.
136+
137+
129138
### Example
130139

131140
```json

0 commit comments

Comments
 (0)