Skip to content

squid: client: crash caused by invalid iterator in _readdir_cache_cb - #65974

Merged
batrick merged 1 commit into
ceph:squidfrom
joscollin:wip-72846-squid
Jul 27, 2026
Merged

batrick merged 1 commit into
ceph:squidfrom
joscollin:wip-72846-squid

Conversation

@joscollin

Copy link
Copy Markdown
Member

Capacity of `readdir_cache` may change after `client_lock` is unlocked in iterations of `readdir_cache`,
and it can cause the iterator to be invalid, then using the invalid iterator in the next iteration will cause crash.
Crash may happen at `Dentry *dn = *pd` (pd points to invalid memory),
or at `if (pd >= dir->readdir_cache.end() || *pd != dn)` (pd is smaller than begin() if idx is negative).
Use index instead of iterator to solve this problem.

Fixes: https://tracker.ceph.com/issues/72247
Signed-off-by: Zhansong Gao <[email protected]>
(cherry picked from commit 9e0488d)
@joscollin joscollin added this to the squid milestone Oct 16, 2025
@joscollin

Copy link
Copy Markdown
Member Author

@batrick batrick modified the milestones: squid, v19.2.4 Mar 18, 2026
@batrick batrick modified the milestones: v19.2.4, v19.2.5 Apr 22, 2026
@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-fail Release engineering: failed backport verification audit. labels May 14, 2026

@neesingh-rh neesingh-rh 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.

@batrick batrick modified the milestones: v19.2.5, v19.2.6 Jul 21, 2026
@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Jul 21, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-pass Release engineering: passed backport verification audit. labels Jul 21, 2026
@batrick
batrick merged commit 84ee890 into ceph:squid Jul 27, 2026
4 checks passed
@joscollin
joscollin deleted the wip-72846-squid branch July 28, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-qa releng-audit-pass Release engineering: passed backport verification audit. wip-jcollin-testing-squid12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants