In the Linux kernel, the following vulnerability has been resolved:
nvdimm: Fix firmware activation deadlock scenarios
Lockdep reports the following deadlock scenarios for CXL root device power-management, deviceprepare(), operations, and deviceshutdown() operations for 'nd_region' devices:
Chain exists of: &nvdimmregionkey --> &nvdimmbus->reconfigmutex --> systemtransitionmutex
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(systemtransitionmutex); lock(&nvdimmbus->reconfigmutex); lock(systemtransitionmutex); lock(&nvdimmregionkey);
Chain exists of: &cxlnvdimmbridgekey --> acpiscanlock --> &cxlroot_key
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&cxlrootkey); lock(acpiscanlock); lock(&cxlrootkey); lock(&cxlnvdimmbridge_key);
These stem from holding nvdimmbuslock() over hibernatequietexec() which walks the entire system device topology taking devicelock() along the way. The nvdimmbuslock() is protecting against unregistration, multiple simultaneous ops callers, and preventing activateshow() from racing activatestore(). For the first 2, the lock is redundant. Unregistration already flushes all ops users, and sysfs already prevents multiple threads to be active in an ops handler at the same time. For the last userspace should already be waiting for its last activatestore() to complete, and does not need activate_show() to flush the write side, so this lock usage can be deleted in these attributes.