Re: [PATCH] nfs/blocklayout: reject stripe volume with zero chunk_size
From: Christoph Hellwig
Date: Fri Oct 16 2026 - 09:02:30 EST
On Fri, Oct 16, 2026 at 12:11:39PM +0800, Liu Chao wrote:
> bl_parse_stripe() copies v->stripe.chunk_size from the volume
> descriptor supplied by the server into d->chunk_size without any
> validation. bl_map_stripe() later divides the block offset by
> d->chunk_size, so a malicious or broken server that advertises a
> stripe volume with chunk_size == 0 triggers a divide error in the
> kernel and crashes the client.
>
> Reject the volume at parse time when chunk_size is zero, before the
> value is stored, so the deviceid node allocation fails cleanly with
> -EIO instead of faulting later.
Looks good:
Reviewed-by: Christoph Hellwig <hch@xxxxxx>