Vulnerability Details : CVE-2021-47195
In the Linux kernel, the following vulnerability has been resolved:
spi: fix use-after-free of the add_lock mutex
Commit 6098475d4cb4 ("spi: Fix deadlock when adding SPI controllers on
SPI buses") introduced a per-controller mutex. But mutex_unlock() of
said lock is called after the controller is already freed:
spi_unregister_controller(ctlr)
-> put_device(&ctlr->dev)
-> spi_controller_release(dev)
-> mutex_unlock(&ctrl->add_lock)
Move the put_device() after the mutex_unlock().
Vulnerability category: Memory Corruption
Products affected by CVE-2021-47195
- cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Exploit prediction scoring system (EPSS) score for CVE-2021-47195
0.07%
Probability of exploitation activity in the next 30 days
EPSS Score History
~ 17 %
Percentile, the proportion of vulnerabilities that are scored at or less
CVSS scores for CVE-2021-47195
Base Score | Base Severity | CVSS Vector | Exploitability Score | Impact Score | Score Source | First Seen |
---|---|---|---|---|---|---|
5.5
|
MEDIUM | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
1.8
|
3.6
|
NIST | 2024-04-19 |
CWE ids for CVE-2021-47195
-
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.Assigned by: nvd@nist.gov (Primary)
References for CVE-2021-47195
-
https://git.kernel.org/stable/c/6c53b45c71b4920b5e62f0ea8079a1da382b9434
spi: fix use-after-free of the add_lock mutex - kernel/git/stable/linux.git - Linux kernel stable treePatch
-
https://git.kernel.org/stable/c/11eab327a2a8bd36c38afbff920ae1bd45588dd4
spi: fix use-after-free of the add_lock mutex - kernel/git/stable/linux.git - Linux kernel stable tree
-
https://git.kernel.org/stable/c/54c2c96eafcfd242e52e932ab54ace4784efe1dd
spi: fix use-after-free of the add_lock mutex - kernel/git/stable/linux.git - Linux kernel stable tree
-
https://git.kernel.org/stable/c/37330f37f6666c7739a44b2b6b95b047ccdbed2d
spi: fix use-after-free of the add_lock mutex - kernel/git/stable/linux.git - Linux kernel stable treePatch
Jump to