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
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:runc implementation will need runtime spec PR to be approved: opencontainers/runtime-spec#1090