Pass root to chroot to for chroot Untar
authorBrian Goff <cpuguy83@gmail.com>
Thu, 30 May 2019 18:15:09 +0000 (11:15 -0700)
committerFelix Geyer <fgeyer@debian.org>
Tue, 3 Sep 2019 17:59:35 +0000 (18:59 +0100)
commit844b9d6cc963a15a78efb86cf5e88e8bfdb52d49
treed0484d5406f5d56e9d889cebdf86cde53b2fdb81
parent629be8b4b482a4bff3070a7cf31de384c00c08a5
Pass root to chroot to for chroot Untar

This is useful for preventing CVE-2018-15664 where a malicious container
process can take advantage of a race on symlink resolution/sanitization.

Before this change chrootarchive would chroot to the destination
directory which is attacker controlled. With this patch we always chroot
to the container's root which is not attacker controlled.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Origin: upstream, https://github.com/moby/moby/pull/39292

Gbp-Pq: Name cve-2018-15664-01-pass-root-to-chroot-to-for-chroot-untar.patch
engine/daemon/archive.go
engine/pkg/chrootarchive/archive.go
engine/pkg/chrootarchive/archive_unix.go
engine/pkg/chrootarchive/archive_windows.go