Skip to content

CDI spec does not allow empty permissions for device nodes #300

@oOraph

Description

@oOraph

When creating a container it can make sense to not allow any rwm operation at first on specified devices: the device node will still be created and the associated shared libraries and tools can still be mounted, eg everything will be prepared for a later usage but the device won't be 'open' yet

This use case is close to the one nvidia-container-toolkit supported in legacy mode with the no-cgroups = true flag (at least this was the way I was using it, I may have misunderstood its purpose, cc @elezar here, will probably be able to clarify :) )

But in the spec, it's explicitely specified

// Cgroups permissions of the device, candidates are one or more of [... r, w, m]

And we can indeed see in the implem here that an empty string is translated to "rwm"

Proposal: change this spec to

// Cgroups permissions of the device, candidates are an empty string or any combination of one or more of [... r, w, m] 

What do you think ?

side note: so far, containerd users are lucky because containerd seems quite flexible and discards unknown chars in the allow string of the oci spec. This statement, coupled with the fact that the cdi spec implem above is flexible enough to pass through any invalid permission string to the oci spec without raising any error, setting the allow string to any unknown char of the cdi spec luckily creates the intented effect, but this is more a flaw than a spec respect, if I understand correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions