Skip to content

Support recursively-readonly mounts with mount_setattr (kernel 5.12) #2823

@AkihiroSuda

Description

@AkihiroSuda

The current OCI mount with options: ["rbind", "ro"] is (surprisingly) not recursively read-only.

mount_setattr(2) introduced in kernel 5.12 can be used for creating recursively-readonly bind mounts:

struct mount_attr attr = {
  .attr_set   = MOUNT_ATTR_RDONLY,
};
rc = mount_setattr(-1, "/mnt/ro", AT_RECURSIVE, &attr, sizeof(attr));

runc implementation will need runtime spec PR to be approved: opencontainers/runtime-spec#1090

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions