From f73bad2a532711089135fbf6167807df6cdb87cc Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 4 Aug 2021 13:34:23 +0000 Subject: [PATCH 1/3] Fix mutex use after free --- iocore/net/UnixNetVConnection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index f0206a92598..b8bbe694bda 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -1004,7 +1004,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; } From 56f7d4d11626f75fd44e52aa2da02dc1c0d95515 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 4 Aug 2021 14:03:39 +0000 Subject: [PATCH 2/3] One more try --- iocore/net/UnixNetVConnection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index b8bbe694bda..153e8ea8271 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -1239,7 +1239,7 @@ UnixNetVConnection::connectUp(EThread *t, int fd) if (fd != NO_FD) { con.fd = NO_FD; } - free(t); + nh->free_netevent(this); return CONNECT_FAILURE; } From f8649006d00461317623026cc1a5ebd850bc4e18 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 4 Aug 2021 15:09:49 +0000 Subject: [PATCH 3/3] Try again --- iocore/net/UnixNetVConnection.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc index 153e8ea8271..0bb3ecf5816 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -1213,7 +1213,6 @@ UnixNetVConnection::connectUp(EThread *t, int fd) res = con.connect(nullptr, options); if (res != 0) { // fast stopIO - nh = nullptr; goto fail; } }