You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 33350a8
Browse filesBrowse the repository at this point in the historyBrowse files
test(cdi): update CDI scenario expectations for derived policy
Record the behavior of the named scenarios once filesystem access is
derived from the selected CDI specs: read-only mounts and library parents
are readable, device nodes are writable, and writable mounts, an unsafe
library parent, and an NVIDIA MPS directory without noexec are rejected.
Add scenarios for the MPS pipe directory with and without noexec.
Signed-off-by: Evan Lezar <[email protected]>
|`mount-under-read-only-baseline`| File at `/usr/share/tmachine-cdi/baseline-read-only-file`, under a directory the sandbox already makes read-only | Read succeeds, write denied. | Unchanged. |
365
-
|`read-only-file`| File at `/tmachine-cdi/read-only/file`| Read and write denied. | Read succeeds outside the baseline grants; write fails. |
366
-
|`read-only-directory`| Directory at `/tmachine-cdi/read-only/directory`| Reading its marker and creating files denied. | Reading its marker succeeds; write fails. |
367
-
|`library-parent`| Marker named `/tmachine-cdi/library/libfixture.so.1`| Read and write denied. | Resolver derives the library parent; the marker is not an actual shared library. |
368
-
|`broad-library-parent`| Marker named `/libtmachinefixture.so.1`| Read and write denied. | Launch rejects expansion to `/`. |
369
-
|`writable-file`| Writable file at `/tmachine-cdi/writable/file`| Read and write denied. | Launch rejects it even with exact or ancestor write grants. |
370
-
|`writable-directory`| Writable directory at `/tmachine-cdi/writable/directory`| Write denied. | Launch rejects it even with exact or ancestor write grants. |
371
-
|`omitted-access-file`| Bind without `ro` or `rw`| Read and write denied. | Effective writable access causes launch rejection. |
372
-
|`device-node`| Null character device at `/dev/tmachine-cdi-null`| Non-root, write denied. | Non-root read/write succeeds; an exact authored read-only entry fails launch. |
373
-
|`device-node-with-gid`| Group-restricted null device at `/dev/tmachine-cdi-group-null`| Non-root with the device's group, write denied. | The generated supplementary GID permits non-root access. |
374
-
|`unix-socket`| Echo socket at `/tmachine-cdi/socket/echo.sock`| Sibling file in the host directory is not visible. | Socket communication succeeds without deriving parent filesystem grants. |
362
+
| Scenario | Injected resource | Asserted |
363
+
| --- | --- | --- |
364
+
|`mount-under-read-only-baseline`| File at `/usr/share/tmachine-cdi/baseline-read-only-file`, under a directory the sandbox already makes read-only | Read succeeds, write denied. |
365
+
|`read-only-file`| File at `/tmachine-cdi/read-only/file`| Read succeeds from the derived grant; write denied. |
366
+
|`read-only-directory`| Directory at `/tmachine-cdi/read-only/directory`| Reading its marker succeeds; creating files denied. |
367
+
|`library-parent`| Marker named `/tmachine-cdi/library/libfixture.so.1`| The derived library-parent grant makes it readable; write denied. The marker is not an actual shared library. |
368
+
|`broad-library-parent`| Marker named `/libtmachinefixture.so.1`| Launch rejects expansion to `/`. |
369
+
|`writable-file`| Writable file at `/tmachine-cdi/writable/file`| Launch rejects the writable mount. |
370
+
|`writable-directory`| Writable directory at `/tmachine-cdi/writable/directory`| Launch rejects the writable mount. |
371
+
|`omitted-access-file`| Bind without `ro` or `rw`| Launch rejects the effectively writable mount. |
372
+
|`mps-pipe-directory`| Directory at `/tmp/nvidia-mps` mounted `nosuid`, `nodev`, `noexec`| Read and write succeed on its contents. |
373
+
|`mps-pipe-directory-without-noexec`| The same directory without `noexec`| Launch rejects the mount. |
374
+
|`device-node`| Null character device at `/dev/tmachine-cdi-null`| Non-root; write succeeds. |
375
+
|`device-node-with-gid`| Group-restricted null device at `/dev/tmachine-cdi-group-null`| Non-root with the device's group; write succeeds. |
376
+
|`unix-socket`| Echo socket at `/tmachine-cdi/socket/echo.sock`| Sibling file in the host directory is not visible. |
375
377
376
378
Every scenario also supplies a spec-level environment marker and a read-only
377
379
mount at `/usr/share/tmachine-cdi/common/spec-marker`, allowing checks of
@@ -383,9 +385,8 @@ with positive cases.
383
385
384
386
The role publishes each scenario's expectations as `scenarios.json` next to the
385
387
fixtures. The `scenario_*` tests load them and assert the behavior recorded in
386
-
`vars/scenarios.yaml`, which is the sandbox's behavior today. A change that
387
-
alters a scenario's behavior, such as #4204 deriving grants from the spec,
388
-
updates those values in the same diff. To record the current behavior, run the
388
+
`vars/scenarios.yaml`. A change that alters a scenario's behavior updates those
389
+
values in the same diff. To record the sandbox's current behavior, run the
389
390
tests with `OPENSHELL_CDI_CAPTURE=1` set for the test process; they then print
0 commit comments