Skip to content

tentacle: librbd: don't complete ImageUpdateWatchers::shut_down() prematurely - #67581

Merged
batrick merged 1 commit into
ceph:tentaclefrom
idryomov:wip-75161-tentacle
Apr 6, 2026
Merged

batrick merged 1 commit into
ceph:tentaclefrom
idryomov:wip-75161-tentacle

Conversation

@idryomov

Copy link
Copy Markdown
Contributor

ImageUpdateWatchers::flush() requests aren't tracked with
m_in_flight-like mechanism the way ImageUpdateWatchers::send_notify()
requests are, but in both cases callbacks that represent delayed work
that is very likely to (indirectly) reference ImageCtx are involved.
When the image is getting closed, ImageUpdateWatchers::shut_down() is
called before anything that belongs to ImageCtx is destroyed.  However,
the shutdown can complete prematurely in the face of a pending flush if
one gets sent shortly before CloseRequest is invoked.  The callback for
that flush will then race with CloseRequest and may execute after parts
of or even the entire ImageCtx is destroyed, leading to use-after-free
and various segfaults.

Fixes: https://tracker.ceph.com/issues/75161
Signed-off-by: Ilya Dryomov <[email protected]>
(cherry picked from commit 3ea6ee6)
@ronen-fr

ronen-fr commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@batrick
batrick merged commit e8b72c6 into ceph:tentacle Apr 6, 2026
8 checks passed
@idryomov
idryomov deleted the wip-75161-tentacle branch April 14, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants