Skip to content

umbrella: rgw: fix use-after-free on cancellation in shard_io::async_reads() - #71136

Merged
batrick merged 1 commit into
ceph:umbrellafrom
cbodley:wip-79558-umbrella
Sep 28, 2026
Merged

batrick merged 1 commit into
ceph:umbrellafrom
cbodley:wip-79558-umbrella

Conversation

@cbodley

@cbodley cbodley commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

when ReadHandler encounters an error and cancels other outstanding
requests, its calls to emit() likely execute those cancellation handlers
inline. these can cause async_reads() to wake up and co_return
prematurely while the initial ReadHandler is still looping over the
'outstanding' list on its stack

prevent this early return by leaving this initial shard in the
'outstanding' list during the cancellation loop

adjust WaitCancellation to use a local variable for the loop condition.
this way if the final cancellation wakes the calling coroutine and
causes it to return, we don't try to access its stack memory again with
'i != outstanding.end()'

Fixes: https://tracker.ceph.com/issues/79095

Signed-off-by: Casey Bodley <[email protected]>
Co-authored-by: Shilpa Jagannath <[email protected]>
(cherry picked from commit 977c9da)
@cbodley
cbodley requested a review from a team as a code owner August 18, 2026 15:55
@cbodley cbodley added this to the umbrella milestone Aug 18, 2026
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Aug 18, 2026
@anrao19

anrao19 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@cbodley

cbodley commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@anrao19

anrao19 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to umbrella integration testing by anuchaithra started 2026-08-19-07:18.

pr verified and approved by @ivancich, more details : https://tracker.ceph.com/issues/79604
@cbodley, if no further testing is not needed then this can be merged

@anrao19

anrao19 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

jenkins test api

edwinzrodriguez added a commit to edwinzrodriguez/ceph that referenced this pull request Sep 20, 2026
After set_balanced_budget() (tracker ceph#71136), Objecter::_throttle_op can
block the calling thread until inflight OSD ops complete and free budget.
OSD replies that release that budget are handled on ms_dispatch. When
ms_dispatch (or the MDS completion finisher) itself blocks in the
throttle — e.g. CDir::_omap_fetch during path_traverse, or
_omap_commit_ops on mds-rank-fin — replies never run, the throttle never
puts, and the MDS wedges (client creates stuck at journal_and_reply).

Dropping mds_lock across Objecter submit is not enough: the dispatch
thread must not wait on the same throttle that only it can advance.

Keep balanced-budget throttling, but move Objecter submits that may block
onto a dedicated objecter_finisher (mds-obj-fin) via queue_objecter().
ms_dispatch and the completion finisher stay free to process replies.
Route dir/inode fetch and commit, backtrace batch commits, OpenFileTable,
SessionMap, and MDSTable Objecter I/O through that path.

Signed-off-by: Edwin Rodriguez <[email protected]>
edwinzrodriguez added a commit to edwinzrodriguez/ceph that referenced this pull request Sep 20, 2026
After set_balanced_budget() (tracker ceph#71136), Objecter::_throttle_op can
block the calling thread until inflight OSD ops complete and free budget.
OSD replies that release that budget are handled on ms_dispatch. When
ms_dispatch (or the MDS completion finisher) itself blocks in the
throttle — e.g. CDir::_omap_fetch during path_traverse, or
_omap_commit_ops on mds-rank-fin — replies never run, the throttle never
puts, and the MDS wedges (client creates stuck at journal_and_reply).

Dropping mds_lock across Objecter submit is not enough: the dispatch
thread must not wait on the same throttle that only it can advance.

Keep balanced-budget throttling, but move Objecter submits that may block
onto a dedicated objecter_finisher (mds-obj-fin) via queue_objecter().
ms_dispatch and the completion finisher stay free to process replies.
Route dir/inode fetch and commit, backtrace batch commits, OpenFileTable,
SessionMap, and MDSTable Objecter I/O through that path.

Signed-off-by: Edwin Rodriguez <[email protected]>
edwinzrodriguez added a commit to edwinzrodriguez/ceph that referenced this pull request Sep 21, 2026
After set_balanced_budget() (tracker ceph#71136), Objecter::_throttle_op can
block the calling thread until inflight OSD ops complete and free budget.
OSD replies that release that budget are handled on ms_dispatch. When
ms_dispatch (or the MDS completion finisher) itself blocks in the
throttle — e.g. CDir::_omap_fetch during path_traverse, or
_omap_commit_ops on mds-rank-fin — replies never run, the throttle never
puts, and the MDS wedges (client creates stuck at journal_and_reply).

Dropping mds_lock across Objecter submit is not enough: the dispatch
thread must not wait on the same throttle that only it can advance.

Keep balanced-budget throttling, but move Objecter submits that may block
onto a dedicated objecter_finisher (mds-obj-fin) via queue_objecter().
ms_dispatch and the completion finisher stay free to process replies.
Route dir/inode fetch and commit, backtrace batch commits, OpenFileTable,
SessionMap, and MDSTable Objecter I/O through that path.

Signed-off-by: Edwin Rodriguez <[email protected]>
edwinzrodriguez added a commit to edwinzrodriguez/ceph that referenced this pull request Sep 21, 2026
After set_balanced_budget() (tracker ceph#71136), Objecter::_throttle_op can
block the calling thread until inflight OSD ops complete and free budget.
OSD replies that release that budget are handled on ms_dispatch. When
ms_dispatch (or the MDS completion finisher) itself blocks in the
throttle — e.g. CDir::_omap_fetch during path_traverse, or
_omap_commit_ops on mds-rank-fin — replies never run, the throttle never
puts, and the MDS wedges (client creates stuck at journal_and_reply).

Dropping mds_lock across Objecter submit is not enough: the dispatch
thread must not wait on the same throttle that only it can advance.

Keep balanced-budget throttling, but move Objecter submits that may block
onto a dedicated objecter_finisher (mds-obj-fin) via queue_objecter().
ms_dispatch and the completion finisher stay free to process replies.
Route dir/inode fetch and commit, backtrace batch commits, OpenFileTable,
SessionMap, and MDSTable Objecter I/O through that path.

Signed-off-by: Edwin Rodriguez <[email protected]>
edwinzrodriguez added a commit to edwinzrodriguez/ceph that referenced this pull request Sep 21, 2026
After set_balanced_budget() (tracker ceph#71136), Objecter::_throttle_op can
block the calling thread until inflight OSD ops complete and free budget.
OSD replies that release that budget are handled on ms_dispatch. When
ms_dispatch (or the MDS completion finisher) itself blocks in the
throttle — e.g. CDir::_omap_fetch during path_traverse, or
_omap_commit_ops on mds-rank-fin — replies never run, the throttle never
puts, and the MDS wedges (client creates stuck at journal_and_reply).

Dropping mds_lock across Objecter submit is not enough: the dispatch
thread must not wait on the same throttle that only it can advance.

Keep balanced-budget throttling, but move Objecter submits that may block
onto a dedicated objecter_finisher (mds-obj-fin) via queue_objecter().
ms_dispatch and the completion finisher stay free to process replies.
Route dir/inode fetch and commit, backtrace batch commits, OpenFileTable,
SessionMap, and MDSTable Objecter I/O through that path.

Fixes: https://tracker.ceph.com/issues/80667
Signed-off-by: Edwin Rodriguez <[email protected]>
@batrick
batrick merged commit 9bbe323 into ceph:umbrella Sep 28, 2026
15 checks passed
@batrick batrick modified the milestones: umbrella, v21.1.2 Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa ready-to-merge releng-audit-pass Release engineering: passed backport verification audit. rgw TESTED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants