Linux RAID subsystem development
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Jack Wang" <jinpu.wang@ionos.com>, <song@kernel.org>,
	 <linux-raid@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <stable@vger.kernel.org>, <yukuai@fnnas.com>
Subject: Re: [PATCH] md/bitmap: fix GPF in write_page caused by resize race
Date: Mon, 26 Jan 2026 13:33:43 +0800	[thread overview]
Message-ID: <ad63a8bf-410f-4b91-aa89-3963dadf87af@fnnas.com> (raw)
In-Reply-To: <20260120102456.25169-1-jinpu.wang@ionos.com>

在 2026/1/20 18:24, Jack Wang 写道:

> A General Protection Fault occurs in write_page() during array resize:
> RIP: 0010:write_page+0x22b/0x3c0 [md_mod]
>
> This is a use-after-free race between bitmap_daemon_work() and
> __bitmap_resize(). The daemon iterates over `bitmap->storage.filemap`
> without locking, while the resize path frees that storage via
> md_bitmap_file_unmap(). `quiesce()` does not stop the md thread,
> allowing concurrent access to freed pages.
>
> Fix by holding `mddev->bitmap_info.mutex` during the bitmap update.
>
> Closes:https://lore.kernel.org/linux-raid/CAMGffE=Mbfp=7xD_hYxXk1PAaCZNSEAVeQGKGy7YF9f2S4=NEA@mail.gmail.com/T/#u
> Cc:stable@vger.kernel.org
> Signed-off-by: Jack Wang<jinpu.wang@ionos.com>
> ---
>   drivers/md/md-bitmap.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Applied with a fixtag:

Fixes: d60b479d177a ("md/bitmap: add bitmap_resize function to allow 
bitmap resizing.")

-- 
Thansk,
Kuai

  reply	other threads:[~2026-01-26  5:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 10:24 [PATCH] md/bitmap: fix GPF in write_page caused by resize race Jack Wang
2026-01-26  5:33 ` Yu Kuai [this message]
2026-01-26  8:21   ` Jinpu Wang

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=ad63a8bf-410f-4b91-aa89-3963dadf87af@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=stable@vger.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