Skip to content

ceph: fix UAF bugs in cap flushing and MDS session handling

Xiubo Li b4-sent ceph-devel lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20260714-ceph-uaf-fixes-bedfe0f2b159

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ceph: fix UAF in __kick_flushing_caps() on cf entry freed during unlockfs/ceph/caps.c+9 -21 reply
2/2ceph: fix UAF in check_new_map() on session freed during unlockfs/ceph/mds_client.c+6 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchViacheslav Dubeyko
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] ceph: fix UAF bugs in cap flushing and MDS session handling

These two patches fix use-after-free bugs:

Patch 1 fixes __kick_flushing_caps(), which drops i_ceph_lock during list_for_each_entry() iteration. A concurrent handle_cap_flush_ack() can free the current cf entry, making the loop's next-pointer advance read freed memory.

Patch 2 fixes check_new_map(), where three code paths drop mdsc->mutex and access the session pointer without taking a reference, opening a window for another thread to unregister and free the session.

---
Xiubo Li (2):
ceph: fix UAF in __kick_flushing_caps() on cf entry freed during unlock
ceph: fix UAF in check_new_map() on session freed during unlock

 fs/ceph/caps.c       | 11 +++++++++--
 fs/ceph/mds_client.c |  6 ++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

---
base-commit: fc67edb66b3c9924c4e0bb366a92b32ea13c526a
change-id: 20260714-ceph-uaf-fixes-bedfe0f2b159

Best regards,

Signature · 1 line
Xiubo Li <[email protected]>