Re: [PATCH] ceph: Use unsigned types for snapshot split counts

From: Xiubo Li

Date: Wed Nov 11 2026 - 20:50:48 EST


Hi Kaho

Thanks for your patch.

The u32 change fixes the backwards move on 64-bit (I reproduced the
KASAN slab-out-of-bounds with injected split counts and it is gone with
this patch), but on 32-bit sizeof(u64) * num_split_inos is still a
32-bit size_t multiplication and wraps: 0xffffffe0 still moves p
backwards, and 0x20000000 leaves p in place while the split loop then
walks split_inos[] far past the front buffer. Could you bound the
counts before advancing p instead, like b3bf89767e3c does for the snap
trace, e.g.

ceph_decode_need(&p, e, size_mul(num_split_inos, sizeof(u64)), bad);

for both arrays, and ceph_decode_skip_n() in the non-split branch?
Also, please rebase onto the current testing branch.