Skip to content

Commit

Permalink
overlay: do not clone source recursively
Browse files Browse the repository at this point in the history
do not clone the source directory in recursive mode (the equivalent of
MS_BIND|MS_RECURSIVE) but use only a regular bind mount.  If
not recursive bind mount is used then the existing overlay mounts are
not replicated.  In this way a new idmapped mount won't need to map
the overlay mount as well, causing the mount_settattr(2) syscall to
fail with EINVAL since it is not possible to idmap an overlay mount
yet.

Closes: containers#1308

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Aug 16, 2022
1 parent 9ba108e commit 57f870e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/overlay/idmapped_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func createIDMappedMount(source, target string, pid int) error {

defer userNsFile.Close()

targetDirFd, err := openTree(source, _OPEN_TREE_CLONE|unix.AT_RECURSIVE)
targetDirFd, err := openTree(source, _OPEN_TREE_CLONE)
if err != nil {
return err
}
Expand Down

0 comments on commit 57f870e

Please sign in to comment.