]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/ceph_timer: Pass reference to waited time on stack 33771/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 6 Mar 2020 03:14:47 +0000 (22:14 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 9 Mar 2020 15:52:45 +0000 (11:52 -0400)
commit451120140e10ec1bd60ae20c33d707e788cfd8f0
tree815937839d54f85a787cda0127212247d95d5d1e
parentf06848c1e9f97f15430c6a951d1224db61d3666b
common/ceph_timer: Pass reference to waited time on stack

std::condition_variable::wait_until takes a const reference to a
time_point. It may access this reference after relinquishing the
mutex, creating a potential use-after-free error if the first event is
shut down.

So, just copy the time onto the stack, so we have a reference that
won't disappear.

https://tracker.ceph.com/issues/44373

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/common/ceph_timer.h