]> 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)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Nov 2021 14:53:01 +0000 (09:53 -0500)
commita68fbb18a96fa89ad2bc61c0f711cf8ce1b9ed31
treeac9d112cb994fa2b32b230be4f4f4e8fd6b5e098
parent3f853538b172d538aaf0b345a237773e7d1e8c69
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