Skip to content

tentacle: client: crash caused by invalid iterator in _readdir_cache_cb - #65957

Merged
batrick merged 1 commit into
ceph:tentaclefrom
joscollin:wip-72845-tentacle
Apr 6, 2026
Merged

batrick merged 1 commit into
ceph:tentaclefrom
joscollin:wip-72845-tentacle

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 tentacle milestone Oct 15, 2025
@joscollin joscollin added the cephfs Ceph File System label Oct 15, 2025
@joscollin

Copy link
Copy Markdown
Member Author

jenkins test make check

@joscollin

Copy link
Copy Markdown
Member Author

@batrick

batrick commented Feb 12, 2026

Copy link
Copy Markdown
Member

@batrick batrick modified the milestones: tentacle, v20.2.2 Mar 25, 2026
@batrick
batrick merged commit c04edb2 into ceph:tentacle Apr 6, 2026
@joscollin
joscollin deleted the wip-72845-tentacle branch April 7, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System ready-to-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants