]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: fix segfault in snapshot replayer shutdown 41503/head
authorArthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Fri, 21 May 2021 15:05:24 +0000 (17:05 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 24 May 2021 14:47:57 +0000 (16:47 +0200)
commitc34729fd0738d3cf3546a6023dc4454c7ab1e0e8
tree9fff517d4b5ed22b8f6f46df0080bbd7094e39a1
parent1fef83d04c80763e7944df3f9ab1d3afaf4cf400
rbd-mirror: fix segfault in snapshot replayer shutdown

If an error arises in the init flow of the snapshot replayer and the
function returns before the call on `register_local_update_watcher`
the value of `m_update_watch_ctx` will not be initialized. Therefore,
on the shutdown phase, the replayer will try to free this pointer
and segfault.

This commit fixes this issue by setting `m_update_watch_ctx` to
`nullptr`.

Fixes: https://tracker.ceph.com/issues/50931
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit 3bc07f6ce06151d96949becb2be423cfabf01429)
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.h