Pass root to chroot to for chroot Untar
authorBrian Goff <cpuguy83@gmail.com>
Thu, 30 May 2019 18:15:09 +0000 (11:15 -0700)
committerArnaud Rebillout <arnaud.rebillout@collabora.com>
Wed, 4 Sep 2019 07:54:29 +0000 (08:54 +0100)
commit3e74e25817102d191de15a996f2585fae7bea68e
treec224dc577e643ab814a283a7570783f79ae283f7
parentbc6e67daf6b8ebac6e5d654e521b3a8a023d6ec5
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_unix_test.go [new file with mode: 0644]
engine/pkg/chrootarchive/archive_windows.go