]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/http: finish_request() after logging errors 59439/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 15 Aug 2024 17:46:07 +0000 (13:46 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 26 Aug 2024 15:27:52 +0000 (11:27 -0400)
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 <cbodley@redhat.com>
(cherry picked from commit 0e00093771010eef907f77eeb281ca2ee789ad9c)

src/rgw/rgw_http_client.cc

index a1873586b013f914bc692d361f76f52e7da9bcc3..a4c0df79275ee9cba7e88083135864ea2433695b 100644 (file)
@@ -1150,7 +1150,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;
@@ -1163,6 +1162,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);
       }
     }
   }