From: Casey Bodley Date: Thu, 15 Aug 2024 17:46:07 +0000 (-0400) Subject: rgw/http: finish_request() after logging errors X-Git-Tag: v20.0.0~1210^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F59243%2Fhead;p=ceph.git rgw/http: finish_request() after logging errors the http manager's background thread is processing responses and logging any errors. but its call to finish_request() -> complete_request() drops its reference with req_data->put() before logging the error message in req_data->error_buf. if put() dropped the last reference, we'd access error_buf after it's freed Fixes: https://tracker.ceph.com/issues/67522 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 9f448bfc355..d3f4b7a4fad 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -1147,7 +1147,6 @@ void *RGWHTTPManager::reqs_thread_entry() http_status = err.http_ret; } int id = req_data->id; - finish_request(req_data, status, http_status); switch (result) { case CURLE_OK: break; @@ -1160,6 +1159,7 @@ void *RGWHTTPManager::reqs_thread_entry() dout(20) << "ERROR: curl error: " << curl_easy_strerror((CURLcode)result) << " req_data->error_buf=" << req_data->error_buf << dendl; break; } + finish_request(req_data, status, http_status); } } }