In the Linux kernel, the following vulnerability has been resolved:
md/dm-raid: don't call mdreapsync_thread() directly
Currently mdreapsyncthread() is called from raidmessage() directly without holding 'reconfigmutex', this is definitely unsafe because mdreapsyncthread() can change many fields that is protected by 'reconfig_mutex'.
However, hold 'reconfigmutex' here is still problematic because this will cause deadlock, for example, commit 130443d60b1b ("md: refactor idle/frozensync_thread() to fix deadlock").
Fix this problem by using stopsyncthread() to unregister sync_thread, like md/raid did.