]> 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:18:29 +0000 (09:18 -0500)
commitf51bae189d19f9c669495694a923cbf9b3c3901d
treebd1c5e6ad2651e457fa3288fb249cfa7a25748bf
parentc18571a89d1f3641ca9ffbd3587cf83a4cf47839
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