Skip to content

bind mount source under a root-only directory fails with EACCES in a user namespace (follow-up to #3719) #3942

Backlog

Description

@saku3

Description

This is a follow-up to #3719.

Currently, youki may fail to bind mount a source path that is inaccessible from within the container's user namespace, such as a root-owned directory with mode 0700.

This is because rootfs preparation is performed by the init process after it has entered the container's user namespace. At this point, the init process no longer has the privileges of root in the host's user namespace.

This issue is not specific to idmapped mounts.

Steps to Reproduce

$ sudo podman --runtime youki run --rm --uidmap 0:100000:65536 --gidmap 0:100000:65536  docker.io/library/busybox id

Error: youki: Error: failed to create container: intermediate process error EPERM: Operation not permitted: OCI permission denied

Expectation

Rootful containers using a user namespace should support authorized bind mounts.

Additional Context 1

I tested running a Kubernetes Pod with hostUsers: false using youki with the changes from #3719. However, the Pod failed to start, and the issue described above appears to be related to this failure.

Additional Context 2

We need to extend the create_idmapped_mount_fd introduced in #3719 to support regular bind mounts as well.

The mountFd function in runc can serve as a reference implementation.

Activity

  1. added this to the v1.0.0 milestone on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions