PM: runtime: Fix a race condition related to device removal
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5e928f77a09a07f9dd595bb8a489965d69a83458 · < bb081fd37f8312651140d7429557258afe51693d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
PM: runtime: Fix a race condition related to device removal
The following code in pm_runtime_work() may dereference the dev->parent pointer after the parent device has been freed:
/* Maybe the parent is now able to suspend. */ if (parent && !parent->power.ignore_children) { spin_unlock(&dev->power.lock);
spin_lock(&parent->power.lock); rpm_idle(parent, RPM_ASYNC); spin_unlock(&parent->power.lock);
spin_lock(&dev->power.lock); }
Fix this by inserting a flush_work() call in pm_runtime_remove().
Without this patch blktest block/001 triggers the following complaint sporadically:
From the CVE record · Linux
A race in Linux kernel runtime power management can cause a worker to access a parent device after it has been freed during device removal. A local block test triggers the use-after-free sporadically; the input does not establish whether an attacker can exploit it or what access they would need.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified.