From: sashiko-bot@kernel.org
To: "Li Youhong" <dayou5941@163.com>,
agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com,
bmarzins@redhat.com
Cc: dm-devel@lists.linux.dev, "Li Youhong" <liyouhong@kylinos.cn>
Subject: Re: [PATCH] dm-raid: fix use-after-free in raid_dtr()
Date: Thu, 12 Nov 2026 08:11:48 +0000 [thread overview]
Message-ID: <sashiko-outbox-210677@kernel.org> (raw)
In-Reply-To: <20261112075741.1449168-1-dayou5941@163.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-raid: wrong Fixes trailer citing a17d1bca5aba instead of
db29d79b34d9
--
commit ea394970c807037990938dd90a475a2a71496a69
Author: Li Youhong <liyouhong@kylinos.cn>
> dm-raid: fix use-after-free in raid_dtr()
>
> raid_dtr() currently flushes event_work only if work_pending() is true.
> This is insufficient because once a worker has dequeued the work, the
> PENDING bit is cleared while do_table_event() is still running. In that
> window raid_set_free() can free the raid_set, leading to a
> use-after-free when do_table_event() accesses rs->ti->table.
>
> Flush event_work whenever it has been initialized, so raid_set is not
> freed while the event handler is still running. The .func guard skips the
> flush for mddev instances where INIT_WORK has not run yet.
>
> Fixes: a17d1bca5aba ("md: fix stopping sync thread")
> Cc: stable@vger.kernel.org
> Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
[Severity: Low]
Commit a17d1bca5aba ("md: fix stopping sync thread") is a stable backport
of f52f5c71f3d4 ("md: fix stopping sync thread"), which only touched
stop_sync_thread() in drivers/md/md.c. The work_pending() check on
rs->md.event_work in raid_dtr() was introduced by db29d79b34d9 ("dm-raid:
delay flushing event_work() after reconfig_mutex is released").
Should the Fixes tag be:
Fixes: db29d79b34d9 ("dm-raid: delay flushing event_work() after reconfig_mutex is released")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112075741.1449168-1-dayou5941@163.com?part=1
next prev parent reply other threads:[~2026-11-12 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:57 [PATCH] dm-raid: fix use-after-free in raid_dtr() Li Youhong
2026-11-12 8:11 ` sashiko-bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-11-12 9:12 Li Youhong
2026-11-12 20:35 ` Mikulas Patocka
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-210677@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agk@redhat.com \
--cc=bmarzins@redhat.com \
--cc=dayou5941@163.com \
--cc=dm-devel@lists.linux.dev \
--cc=liyouhong@kylinos.cn \
--cc=mpatocka@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=snitzer@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