Skip to content

mds: fix heap-use-after-free in C_Flush_Journal - #62553

Merged
vshankar merged 2 commits into
ceph:mainfrom
mchangir:mds-fix-heap-ause-after-free-in-C_Flush_Journal
Apr 15, 2025
Merged

vshankar merged 2 commits into
ceph:mainfrom
mchangir:mds-fix-heap-ause-after-free-in-C_Flush_Journal

Conversation

@mchangir

@mchangir mchangir commented Mar 28, 2025 •

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/69953
Signed-off-by: Milind Changire [email protected]

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

Moved dout() statement out of trim_expired_segments() to avoid
dereferencing 'this' object after object deletion via context completion
handler.

Fixes: https://tracker.ceph.com/issues/69953
Signed-off-by: Milind Changire <[email protected]>
Resolved use-after-free issue of ESubtreeMap. The subtreemap event gets
destroyed after it is submitted to the log.

MDLog::submit_event() now returns a sequence number of the submitted event.

Fixes: https://tracker.ceph.com/issues/69953
Signed-off-by: Milind Changire <[email protected]>
@github-actions github-actions Bot added the cephfs Ceph File System label Mar 28, 2025
Comment thread src/mds/MDLog.h
LogSegment* _start_new_segment(SegmentBoundary* sb);
void _segment_upkeep();
void _submit_entry(LogEvent* e, MDSLogContextBase* c);
LogSegment::seq_t _submit_entry(LogEvent* e, MDSLogContextBase* c);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid this in the future, we should pass a smart unique_ptr (r-value) to the LogEvent.

Comment thread src/mds/MDSRank.cc Resolved
@vshankar

vshankar commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

@vshankar

Copy link
Copy Markdown
Contributor

Oh, what fun - not a single failure that I suspected from the original fs suite run is seen with a rerun. So, it's unlikely that this PR is related to the failures originally seen. This is good to merge IMO.

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test make check

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants