You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/08/04 22:35:51 UTC

[trafficserver] branch 9.0.x updated: Fix mutex use after free (#8209)

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

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 3f271ec  Fix mutex use after free (#8209)
3f271ec is described below

commit 3f271ec7924b11bc131e0b797a6d14d95e1e50f3
Author: Susan Hinrichs <sh...@verizonmedia.com>
AuthorDate: Wed Aug 4 16:03:31 2021 -0500

    Fix mutex use after free (#8209)
    
    * Fix mutex use after free
    
    * One more try
    
    * Try again
    
    (cherry picked from commit 3c03bd68a9bb8b68f5e6e532c6d60ddb58ee7572)
---
 iocore/net/UnixNetVConnection.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 489ebf9..4360ce0 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1073,7 +1073,7 @@ UnixNetVConnection::startEvent(int /* event ATS_UNUSED */, Event *e)
   if (!action_.cancelled) {
     connectUp(e->ethread, NO_FD);
   } else {
-    this->free(e->ethread);
+    get_NetHandler(e->ethread)->free_netevent(this);
   }
   return EVENT_DONE;
 }
@@ -1285,7 +1285,6 @@ UnixNetVConnection::connectUp(EThread *t, int fd)
     res = con.connect(nullptr, options);
     if (res != 0) {
       // fast stopIO
-      nh = nullptr;
       goto fail;
     }
   }
@@ -1311,7 +1310,7 @@ fail:
   if (fd != NO_FD) {
     con.fd = NO_FD;
   }
-  free(t);
+  nh->free_netevent(this);
   return CONNECT_FAILURE;
 }