In the Linux kernel, the following vulnerability has been resolved: 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.
https://git.kernel.org/stable/c/e8860e5773569fa297e1906747e770b7afe8bea4
https://git.kernel.org/stable/c/abcf294055516f8e494c04b8731e569ee623be38
https://git.kernel.org/stable/c/46af2c975958119290ddcd984a98491966123a7b
https://git.kernel.org/stable/c/178d1d3260c97ab6eabc9b9c0e07ebec2c5c9936