From: "Yu Kuai" <yukuai@fnnas.com>
To: "Jinpu Wang" <jinpu.wang@ionos.com>,
"linux-raid" <linux-raid@vger.kernel.org>,
"Song Liu" <song@kernel.org>,
"open list" <linux-kernel@vger.kernel.org>, <yukuai@fnnas.com>
Subject: Re: [BUG] md: race between bitmap_daemon_work and __bitmap_resize leading to use-after-free
Date: Tue, 20 Jan 2026 00:44:02 +0800 [thread overview]
Message-ID: <b1824ba1-a051-4c4f-bbf9-c28fb225edfc@fnnas.com> (raw)
In-Reply-To: <CAMGffE=Mbfp=7xD_hYxXk1PAaCZNSEAVeQGKGy7YF9f2S4=NEA@mail.gmail.com>
Hi,
在 2026/1/19 23:14, Jinpu Wang 写道:
> We are looking for suggestions on the best way to synchronize this. It
> seems we need to either: a) Ensure the md thread's daemon work is
> stopped/flushed before
>
> __bitmap_resize proceeds with unmapping. b) Protect bitmap->storage
> replacement with a lock that
> bitmap_daemon_work also respects.
>
> Any thoughts on the preferred approach?
create/free/resize and access bitmap other than IO path should all be
protected with mddev->bitmap_info.mutex.
--
Thansk,
Kuai
next prev parent reply other threads:[~2026-01-19 16:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 15:14 [BUG] md: race between bitmap_daemon_work and __bitmap_resize leading to use-after-free Jinpu Wang
2026-01-19 16:44 ` Yu Kuai [this message]
2026-01-19 19:05 ` 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=b1824ba1-a051-4c4f-bbf9-c28fb225edfc@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 \
/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