Skip to content

[Bug]: Recursive mounts with access-time settings do not work correctly #3399

@saku3

Description

@saku3

Bug Description

This is the same issue as the one in runc below.

opencontainers/runc#5095

Specifying the following OCI mount options results error.

ratime
rnostrictatime

Steps to Reproduce

Steps to reproduce the issue

  1. Set up the mounts
TESTVOLUME=/tmp/mounts_recursive
sudo mkdir -p "$TESTVOLUME"
sudo mount -t tmpfs none "$TESTVOLUME"
sudo mkdir -p "$TESTVOLUME/subvol"
sudo mount -t tmpfs none "$TESTVOLUME/subvol"
  1. Add a mount entry to config.json
{
	"destination": "/mnt",
	"source": "/tmp/mounts_recursive",
	"options": ["rbind", "ratime"]
}
  1. Run youki
$ youki run container
ERROR libcontainer::rootfs::mount: failed to mount Mount { destination: "/mnt", typ: None, source: Some("/tmp/mounts_recursive"), options: Some(["rbind", "ratime"]) }: syscall

The error occurs in mount_setattr.

$ strace -f -e trace=mount_setattr youki run container
...
[pid  9668] mount_setattr(12, "", AT_EMPTY_PATH|AT_RECURSIVE, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument)
...

Expectation

Specifying the mount options above should still allow the container to start successfully.

System and Setup Info

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions