Re: [PATCH] ceph: Use unsigned types for snapshot split counts
From: Jerry Jiang
Date: Thu Nov 12 2026 - 22:22:45 EST
Hi Xiubo
I've made the changes you've requested, please let me know if any
other changes are needed.
v2 has been proposed:
https://lore.kernel.org/all/20261113030257.1061200-2-kj2864@xxxxxxx/
On Wed, Nov 11, 2026 at 8:31 PM Xiubo Li <xiubli@xxxxxxxxxx> wrote:
>
> 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.