Re: [PATCH 0/9] ceph: fix mdsmap and osdmap use-after-free in unlocked readers
From: Alex Markuze
Date: Sun Nov 22 2026 - 14:52:44 EST
Hi Max,
There's a separate xattr-limit window in patch 3. The map handler installs
the new map but updates max_xattr_size only after check_new_map(), which
can drop mdsc->mutex and wait for a reconnect. During that interval,
__ceph_setxattr() still uses the previous limit.
For example, if the limit is lowered while another MDS is reconnecting,
a client with XATTR_EXCL on a file can accept a value that fits the old
limit but exceeds the new one. An MDS using the new limit can then discard
the oversized dirty xattr on cap flush, even though setxattr() returned
success.
Could the new limit be published before check_new_map() drops the mutex?
Also, __build_xattrs() can drop i_ceph_lock; could the second size check
reload the limit instead of reusing the value sampled before that call?
Thanks,
Alex