mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Commitsb2fd67de77(and the follow-up commitf6b80253b8) updated doesSupportNativeDiff to detect whether the host can support native overlay diffing with userns enabled. As a result, [useNaiveDiff] would now return "false" in cases where it previously would return "true" (and thus skip). However, [overlay2], unlike [fuse-overlay] did not take user namespaces into account, when using the native differ, and it therefore did not set the InUserNS option in TarOptions. As a result pkg/archive.createTarFile would attempt tocreate [device-nodes] through [handleTarTypeBlockCharFifo] which would fail, but the resulting error `EPERM` would be discarded, and `createTarFile` would not return early, therefor attempting to [os.LChown] the missing file, ultimately resulting in an error: failed to Lchown "/dev/console" for UID 0, GID 0: lchown /dev/console: no such file or directory This patch fixes the missing option in overlay. [useNaiveDiff]:47eebd718f/daemon/graphdriver/overlay2/overlay.go (L248-L256)[overlay2]:47eebd718f/daemon/graphdriver/overlay2/overlay.go (L684-L689)[fuse-overlay]:47eebd718f/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go (L456-L462)[device-nodes]:ff1e2c0de7/pkg/archive/archive.go (L713-L720)[handleTarTypeBlockCharFifo]:47eebd718f/pkg/archive/archive_unix.go (L110-L114)[os.LChown]:ff1e2c0de7/pkg/archive/archive.go (L762-L773)Signed-off-by: Sebastiaan van Stijn <github@gone.nl>