Re: [BUG] md: race between bitmap_daemon_work and __bitmap_resize leading to use-after-free

Jinpu Wang <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.raid
Message-ID <CAMGffEkvZUAgjxYSPL39tfDhWqxZB-o-zbe-rrMAPeuQ0vr4fA@mail.gmail.com>
Hi Kuai,

On Mon, Jan 19, 2026 at 5:44 PM Yu Kuai <[email protected]> wrote:
>
> 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.

Thx for the suggestion, I will work on a fix.
>
> --
> Thansk,
> Kuai
Jinpu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.