All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kyuwon Cho" <kyuwoncho18@gmail.com>
Cc: linux-raid@vger.kernel.org, yukuai@fygo.io
Subject: Re: [PATCH v3] md: reject inconsistent reshape state during assembly
Date: Sun, 06 Dec 2026 05:03:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-252155@kernel.org> (raw)
In-Reply-To: <179643369147.1996725.14454060339934285854@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] md: Fixes trailer cites ba1b41b6b4e3 instead of f67055780caa
--

commit d43e112cbe49427a0afdd161f5effdf4bbe6470e
Author: Kyuwon Cho <kyuwoncho18@gmail.com>

> md: reject inconsistent reshape state during assembly
>
> slot_store() permits a slot below raid_disks + delta_disks while a
> reshape prepares additional slots. The v0.90 and v1.x validators can
> copy a nonzero delta_disks from a superblock whose reshape_position is
> MaxSector. The stale delta lets slot_store() pass an out-of-range slot
> to a personality whose table was allocated for raid_disks only.
>
> KASAN reports:
>
>   BUG: KASAN: slab-out-of-bounds in raid10_add_disk (drivers/md/raid10.c:2106)
>   Call Trace:
>    raid10_add_disk (drivers/md/raid10.c:2106)
>    slot_store (drivers/md/md.c:3370)
>    rdev_attr_store (drivers/md/md.c:3788)
>
> Validate each metadata format's raw reshape state while loading the
> superblock, before it can be copied into rdev or mddev. Reject zero-disk
> v1.x metadata and inactive reshape state that carries changed geometry,
> direction, or data-offset fields.
>
> Fixes: ba1b41b6b4e3 ("md: range check slot number when manually adding a spare.")
> Closes: https://lore.kernel.org/linux-raid/179489219553.3099317.5403557298223708081@gmail.com/
> Signed-off-by: Kyuwon Cho <kyuwoncho18@gmail.com>

[Severity: Low]
Should the Fixes tag cite f67055780caa ("[PATCH] md: Checkpoint and allow
restart of raid5 reshape") instead of ba1b41b6b4e3 ("md: range check slot
number when manually adding a spare.")?

Before that commit, the active-array branch of slot_store() calling
pers->hot_add_disk() -> raid10_add_disk() had no upper-bound check on slot
at all.  It narrowed the active-array range and only relaxed the check in
the inactive-array branch, which does not call hot_add_disk().

This patch does not touch slot_store(); it validates inactive reshape
metadata in super_90_load() and super_1_load() before super_90_validate()
and super_1_validate() copy it, which is behavior introduced by
f67055780caa ("[PATCH] md: Checkpoint and allow restart of raid5 reshape").

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179643369147.1996725.14454060339934285854@gmail.com?part=1

      reply	other threads:[~2026-12-06  5:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  4:46 [PATCH v3] md: reject inconsistent reshape state during assembly Kyuwon Cho
2026-12-06  5:03 ` sashiko-bot [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=sashiko-outbox-252155@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kyuwoncho18@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yukuai@fygo.io \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.