Project

General

Profile

Actions

Bug #77501

closed
YS YS

librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down()

Bug #77501: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down()

Added by Yuechi Sun 6 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Development
Backport:
squid,tentacle,umbrella
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
rbd
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-297-g6b040893f2
Released In:
Upkeep Timestamp:
2026-08-27T18:35:35+00:00

Description

AbstractWriteLog::shut_down() calls perf_stop(), which deletes
m_perfcounter, but the 5s periodic_stats timer is only canceled later
in the destructor. If it fires in between, periodic_stats ->
update_image_cache_state dereferences the freed m_perfcounter. Cancel
the timer under m_timer_lock first, mirroring the destructor.

Hit on riscv64 (sg2044) running
TestMockCacheSSDWriteLog.compare_and_write_compare_failed, which
finishes well under the 5s timer interval. It is a race rather than
arch-specific, but reproduces reliably there.


Related issues 3 (0 open — 3 closed)

Copied to rbd - Backport #77557: tentacle: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down()ResolvedIlya Dryomov

Actions
Copied to rbd - Backport #77558: squid: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down()ResolvedIlya Dryomov

Actions
Copied to rbd - Backport #77559: umbrella: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down()ResolvedIlya Dryomov

Actions

KC Updated by Kefu Chai 6 months ago Actions #1

  • Project changed from Ceph to rbd
  • Category deleted (librbd)
  • Status changed from New to Fix Under Review
  • Assignee set to Yuechi Sun

ID Updated by Ilya Dryomov 6 months ago Actions #2

  • Backport set to squid,tentacle,umbrella

UB Updated by Upkeep Bot 5 months ago Actions #3

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to 6b040893f275a9aab03879de607864755c86227f
  • Fixed In set to v21.3.0-297-g6b040893f2
  • Upkeep Timestamp set to 2026-06-22T08:13:36+00:00

UB Updated by Upkeep Bot 5 months ago Actions #4

  • Copied to Backport #77557: tentacle: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down() added

UB Updated by Upkeep Bot 5 months ago Actions #5

  • Copied to Backport #77558: squid: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down() added

UB Updated by Upkeep Bot 5 months ago Actions #6

  • Copied to Backport #77559: umbrella: librbd/cache/pwl: use-after-free of m_perfcounter when periodic_stats timer fires during shut_down() added

UB Updated by Upkeep Bot 5 months ago Actions #7

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #8

  • Status changed from Pending Backport to Resolved
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-06-22T08:13:36+00:00 to 2026-08-27T18:35:35+00:00
Actions

Also available in: PDF Atom