From 0c7bbcecd13a254f2b1096f755c0698c592602f2 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Mon, 11 Sep 2023 20:04:29 +0000 Subject: [PATCH 1/3] Fix use-after-free issue --- proxy/http/HttpSM.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 8221a3ca38c..7cf0a5b5f11 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -7483,6 +7483,7 @@ HttpSM::kill_this() server_txn = nullptr; } if (_ua.get_txn()) { + _ua.get_txn()->attach_server_session(nullptr); _ua.get_txn()->transaction_done(); } From 66d3972e90744b7482d624e6d384451e63b1dd09 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Mon, 11 Sep 2023 20:43:21 +0000 Subject: [PATCH 2/3] Make assert happy --- proxy/http/HttpSM.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 7cf0a5b5f11..aa1ed0fd6fd 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -7483,7 +7483,9 @@ HttpSM::kill_this() server_txn = nullptr; } if (_ua.get_txn()) { - _ua.get_txn()->attach_server_session(nullptr); + if (this->ssession != nullptr) { + _ua.get_txn()->attach_server_session(nullptr); + } _ua.get_txn()->transaction_done(); } From 40b4aeea2f487281e5df01c434dfa1b6d0a12faa Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Mon, 11 Sep 2023 21:21:32 +0000 Subject: [PATCH 3/3] Correctly make assert happy --- proxy/http/HttpSM.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index aa1ed0fd6fd..90d4d2d4935 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -7483,7 +7483,7 @@ HttpSM::kill_this() server_txn = nullptr; } if (_ua.get_txn()) { - if (this->ssession != nullptr) { + if (_ua.get_txn()->get_server_session() != nullptr) { _ua.get_txn()->attach_server_session(nullptr); } _ua.get_txn()->transaction_done();