This is an automated email from the ASF dual-hosted git repository. qianzhang pushed a commit to branch 1.6.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 26e122c217a707ebf4e081a18404e5d0321ab81a Author: Andrei Budnik <[email protected]> AuthorDate: Fri Apr 5 13:06:49 2019 +0200 Fixed use-after-free bug in Docker provisioner store. Deferred lambda callback of the `moveLayers()` to the `StoreProcess` to prevent use-after-free of the process object since the callback refers to the `StoreProcess` class variable `flags`. Review: https://reviews.apache.org/r/70405 --- src/slave/containerizer/mesos/provisioner/docker/store.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slave/containerizer/mesos/provisioner/docker/store.cpp b/src/slave/containerizer/mesos/provisioner/docker/store.cpp index f0ea3d2..d4858c1 100644 --- a/src/slave/containerizer/mesos/provisioner/docker/store.cpp +++ b/src/slave/containerizer/mesos/provisioner/docker/store.cpp @@ -421,7 +421,7 @@ Future<Image> StoreProcess::moveLayers( } return collect(futures) - .then([=]() -> Future<Image> { + .then(defer(self(), [=]() -> Future<Image> { if (image.has_config_digest()) { const string configSource = path::join(staging, image.config_digest()); const string configTarget = paths::getImageLayerPath( @@ -439,7 +439,7 @@ Future<Image> StoreProcess::moveLayers( } return image; - }); + })); }
