slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a899d324863a3d15ce0eea513884e1b73a758c58 · < 9708eb50fd7343145b422be852f890212155d845| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock
During the SSR/PDR down notification the tx_lock is taken with the intent to provide synchronization with active DMA transfers.
But during this period qcom_slim_ngd_down() is invoked, which ends up in slim_report_absent(), which takes the slim_controller lock. In multiple other codepaths these two locks are taken in the opposite order (i.e. slim_controller then tx_lock).
The result is a lockdep splat, and a possible deadlock:
rprocctl/449 is trying to acquire lock: ffff00009793e620 (&ctrl->lock){+.+.}-{4:4}, at: slim_report_absent (drivers/slimbus/core.c:322) slimbus
but task is already holding lock: ffff00009793fb50 (&ctrl->tx_lock){+.+.}-{4:4}, at: qcom_slim_ngd_ssr_pdr_notify (drivers/slimbus/qcom-ngd-ctrl.c:1475) slim_qcom_ngd_ctrl
which lock already depends on the new lock.
From the CVE record · Linux
The Linux kernel's Qualcomm SLIMbus controller can acquire two locks in opposite orders during an SSR/PDR down notification, causing a possible deadlock. The input does not specify how an attacker could trigger it or whether access, authentication, or user interaction is required.
Engineers running Linux kernels with the Qualcomm SLIMbus controller should check their builds; affected versions are not specified.