Skip to content

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

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

mds: fix heap-use-after-free in C_Flush_Journal#62553
vshankar merged 2 commits intoceph:mainfrom
mchangir:mds-fix-heap-ause-after-free-in-C_Flush_Journal

Conversation

@mchangir
Copy link
Contributor

@mchangir mchangir commented Mar 28, 2025

Fixes: https://tracker.ceph.com/issues/69953
Signed-off-by: Milind Changire mchangir@redhat.com

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 <mchangir@redhat.com>
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 <mchangir@redhat.com>
@github-actions github-actions bot added the cephfs Ceph File System label Mar 28, 2025
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
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.

@vshankar
Copy link
Contributor

vshankar commented Apr 7, 2025

This PR is under test in https://tracker.ceph.com/issues/70819.

@vshankar
Copy link
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
Contributor

jenkins test make check

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

@vshankar vshankar merged commit 1a947b3 into ceph:main Apr 15, 2025
19 checks passed
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