This is an automated email from the ASF dual-hosted git repository.

abudnik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new db917f6  Fixed use-after-free bug in Docker provisioner store.
db917f6 is described below

commit db917f639e2d05fcf493e87649f42ddd2abfeae0
Author: Andrei Budnik <abud...@mesosphere.com>
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 909364d..36b2c7d 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/store.cpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/store.cpp
@@ -446,7 +446,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(
@@ -464,7 +464,7 @@ Future<Image> StoreProcess::moveLayers(
       }
 
       return image;
-    });
+    }));
 }
 
 

Reply via email to