diff options
| author | Li Youhong <liyouhong@kylinos.cn> | 2026-11-12 17:12:05 +0800 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-11-12 20:21:23 +0100 |
| commit | 46af2c975958119290ddcd984a98491966123a7b (patch) | |
| tree | 2fbad797d64bc6aee8b3ba5b4e1c9691387d4262 /rust/kernel/alloc | |
| parent | e5e03918fbec31f0c896f4f43c2bd2aadf35d43d (diff) | |
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: db29d79b34d9 ("dm-raid: delay flushing event_work() after reconfig_mutex is released")
Cc: stable@vger.kernel.org
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
