Repository navigation
src/osd/ECCommon.cc: fix use-after-free in do_read_op - #70853
Merged
Merged
Conversation
Contributor
Author
|
jenkins test windows |
shraddhaag
marked this pull request as ready for review
August 6, 2026 10:59
shraddhaag
force-pushed
the
wip-shraddhaag-fix-hobject
branch
from
August 6, 2026 11:18
47209fb to
09dea78
Compare
Contributor
|
This PR has been added to wip-bharath10-testing-20260806.013257-main. |
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
Contributor
Author
|
jenkins test api |
Contributor
Author
|
jenkins test windows |
shraddhaag
force-pushed
the
wip-shraddhaag-fix-hobject
branch
from
August 10, 2026 03:33
09dea78 to
f119131
Compare
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
Issue: We saw an assert in ECCommon::ReadOp::print, surfacing as ceph_assert(!max || (*this == hobject_t(hobject_t::get_max()))). Inpecting the hobject in hobject_t::is_max(), it became clear that the memory is being streamed after being freed. After investigation, ECCommon::ReadPipeline::do_read_op, at the very end in the WITH_CRIMSON block, via handle_sub_read_n_reply, when seastore serves the read from cache, the pipeline completes sychronously and in complete_read_op() tid is cleared from tid_to_read_map, effectively freeing rop. The dout after the WITH_CRIMSON block, when trying to print the rop, tries to dereference freed memory and crashes. Solution: Simply moving the dout to before the WITH_CRIMSON block fixes the use-after-free issue. Fixes: https://tracker.ceph.com/issues/78772 Signed-off-by: Shraddha Agrawal <[email protected]>
shraddhaag
force-pushed
the
wip-shraddhaag-fix-hobject
branch
from
August 10, 2026 09:56
f119131 to
606a817
Compare
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
We saw an assert in
ECCommon::ReadOp::print, surfacing asceph_assert(!max || (*this == hobject_t(hobject_t::get_max()))).Inpecting the
hobjectinhobject_t::is_max(), it became clear that the memory is being streamed after being freed.Root Cause
ECCommon::ReadPipeline::do_read_op, at the very end in the WITH_CRIMSON block:In
handle_sub_read_n_reply, seastore can sometimes serve the read from cache. If the read doesn't require anything from other shards and the op completes inline after the cache read, as seen in logs:Since the read op completes inline, the pipeline completes sychronously and in
complete_read_op()tidand its correspondingReadOpis erased fromtid_to_read_map, effectively leaving a danglingrop:When this returns, the
doutinECCommon::ReadPipeline::do_read_opafter theWITH_CRIMSON block, when trying to print the rop, tries to dereference freed memory and crashes, leading to the above failure.
Solution
Simply moving the
doutto before theWITH_CRIMSONblock fixes the use-after-free issue.09dea78 only this commit is relevant. The other two commits are from #70833.
Fixes: https://tracker.ceph.com/issues/78772
Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.