Linux NFS development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Liu Chao <liuc63@xiaopeng.com>
Cc: Anna Schumaker <anna@kernel.org>,
	Trond Myklebust <trondmy@kernel.org>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfs/blocklayout: reject stripe volume with zero chunk_size
Date: Fri, 16 Oct 2026 06:01:37 -0700	[thread overview]
Message-ID: <atIgMa2kTStMxe9e@infradead.org> (raw)
In-Reply-To: <20261016041139.2292455-1-liuc63@xiaopeng.com>

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@lst.de>


      reply	other threads:[~2026-10-16 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  4:11 [PATCH] nfs/blocklayout: reject stripe volume with zero chunk_size Liu Chao
2026-10-16 13:01 ` Christoph Hellwig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atIgMa2kTStMxe9e@infradead.org \
    --to=hch@infradead.org \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=liuc63@xiaopeng.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox