In the Linux kernel, the following vulnerability has been resolved:
soundwire: bus: Fix unbalanced pmruntimeput() causing usage count underflow
This reverts commit 443a98e649b4 ("soundwire: bus: use pmruntimeresumeandget()")
Change calls to pmruntimeresumeandget() back to pmruntimegetsync(). This fixes a usage count underrun caused by doing a pmruntimeput() even though pmruntimeresumeand_get() returned an error.
The three affected functions ignore -EACCES error from trying to get pmruntime, and carry on, including a put at the end of the function. But pmruntimeresumeandget() does not increment the usage count if it returns an error. So in the -EACCES case you must not call pmruntime_put().
The documentation for pmruntimegetsync() says: "Consider using pmruntimeresumeand_get() ... as this is likely to result in cleaner code."
In this case I don't think it results in cleaner code because the pmruntimeput() at the end of the function would have to be conditional on the return value from pmruntimeresumeandget() at the top of the function.
pmruntimegetsync() doesn't have this problem because it always increments the count, so always needs a put. The code can just flow through and do the pmruntime_put() unconditionally.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54259.json",
"cna_assigner": "Linux"
}