5.5

CVE-2021-47195

spi: fix use-after-free of the add_lock mutex

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().
Daten sind bereitgestellt durch National Vulnerability Database (NVD)
LinuxLinux Kernel Version > 5.15.0 < 5.15.5
VulnDex Vulnerability Enrichment
Diese Information steht angemeldeten Benutzern zur Verfügung. Login Login
Zu dieser CVE wurde keine Warnung gefunden.
EPSS Metriken
Typ Quelle Score Percentile
EPSS FIRST.org 0.22% 0.121
CVSS Metriken
Quelle Base Score Exploit Score Impact Score Vector String
NIST 5.5 1.8 3.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-416 Use After Free

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.

https://git.kernel.org/stable/c/11eab327a2a8bd36c38afbff920ae1bd45588dd4
https://git.kernel.org/stable/c/37330f37f6666c7739a44b2b6b95b047ccdbed2d
Patch
https://git.kernel.org/stable/c/54c2c96eafcfd242e52e932ab54ace4784efe1dd
https://git.kernel.org/stable/c/6c53b45c71b4920b5e62f0ea8079a1da382b9434
Patch