container-device-interface icon indicating copy to clipboard operation
container-device-interface copied to clipboard

CDI spec file gets created with 600 access

Open tkatila opened this issue 1 year ago • 3 comments

We have written a CDI spec generator tool for Intel GPUs. When using it, I noticed that even though the directory for the CDI specs is created with 755, the files themselves are created with 600. We are using cache's WriteSpec function. This has the downside that docker or podman has to be executed with sudo/root so it can read the CDI specs. As the CDI specs typically reside in root access directories (/etc, /var/run), executing the generator without sudo isn't possible.

For non-root use, I believe the CDI specs should be readable by all.

tkatila avatar Aug 15 '24 16:08 tkatila

We use the following logic to ensure that the spec is world-readable: https://github.com/NVIDIA/nvidia-container-toolkit/blob/f959c0daaa30e7079458e550ed867cd4faf4a102/pkg/nvcdi/spec/spec.go#L67-L69

It may be useful to consider using something like renameio though to ensure atomic writes: https://github.com/NVIDIA/k8s-device-plugin/blob/c181c46f5fdeb367f16c5f9ab8be83c3ae60a90e/internal/lm/output.go#L90

elezar avatar Aug 27 '24 12:08 elezar

This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.

github-actions[bot] avatar Dec 03 '24 04:12 github-actions[bot]

This issue was automatically closed due to inactivity.

github-actions[bot] avatar Jan 03 '25 04:01 github-actions[bot]