You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2019/07/22 21:10:12 UTC

[mesos] branch master updated: Fixed use-after-free bug in `PendingFutureTrackerProcess`.

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

gilbert 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 037323d  Fixed use-after-free bug in `PendingFutureTrackerProcess`.
037323d is described below

commit 037323d443a2707c3631fc88931f8d39f5f24afa
Author: Andrei Budnik <ab...@mesosphere.com>
AuthorDate: Mon Jul 22 13:57:03 2019 -0700

    Fixed use-after-free bug in `PendingFutureTrackerProcess`.
    
    Previously, the future tracker subscribed on `onAny`, `onAbandoned`,
    `onDiscard` events for the future using callbacks, which accept
    the same iterator to the `pending` list. Since `onAny` and `onDiscard`
    events can overlap, the same callback can be called more than once,
    which leads to accessing invalidated iterator. This patch fixes the
    problem by removing `onDiscard` handler because it does not transition
    a future to the terminal state.
    
    Review: https://reviews.apache.org/r/71136/
---
 src/common/future_tracker.hpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/common/future_tracker.hpp b/src/common/future_tracker.hpp
index a3f191a..37656ff 100644
--- a/src/common/future_tracker.hpp
+++ b/src/common/future_tracker.hpp
@@ -63,8 +63,6 @@ public:
       .onAny(process::defer(
           self(), &PendingFutureTrackerProcess::eraseFuture, it))
       .onAbandoned(process::defer(
-          self(), &PendingFutureTrackerProcess::eraseFuture, it))
-      .onDiscard(process::defer(
           self(), &PendingFutureTrackerProcess::eraseFuture, it));
   }