CVE-2021-47195
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
10/04/2024
Last modified:
17/11/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
spi: fix use-after-free of the add_lock mutex<br />
<br />
Commit 6098475d4cb4 ("spi: Fix deadlock when adding SPI controllers on<br />
SPI buses") introduced a per-controller mutex. But mutex_unlock() of<br />
said lock is called after the controller is already freed:<br />
<br />
spi_unregister_controller(ctlr)<br />
-> put_device(&ctlr->dev)<br />
-> spi_controller_release(dev)<br />
-> mutex_unlock(&ctrl->add_lock)<br />
<br />
Move the put_device() after the mutex_unlock().
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15.0 (excluding) | 5.15.5 (excluding) |
To consult the complete list of CPE names with products and versions, see this page



