]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw/beast: reference count Connections for timeout_handler
authorCasey Bodley <cbodley@redhat.com>
Thu, 11 Nov 2021 17:01:06 +0000 (12:01 -0500)
committerCory Snyder <csnyder@iland.com>
Tue, 16 Nov 2021 14:59:25 +0000 (09:59 -0500)
commit3a7bc71d68d67e56e9d50100090d4334a9ffe098
tree574757b539642ffbf4e1eeefb467634740044364
parent161538eb626fdecff84e5882bb1e0ada51ff83b5
rgw/beast: reference count Connections for timeout_handler

resolves a use-after-free in the timeout_handler, where a timeout fires
and schedules the timeout_handler for execution, but the coroutine exits
and destroys the socket before asio executes the timeout_handler

timeout_handler now holds a reference on the Connection to extend its
lifetime

now that the Connection is allocated on the heap, we can include the
parse_buffer in this memory instead of allocating it separately

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_frontend.cc
src/rgw/rgw_asio_frontend_timer.h