CVE-2021-47195

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

published April 10, 2024

CVSS
—
EPSS
0%
Percentile
11.7
In the wild
Unconfirmed
What it is

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().

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.00219 · 11.7th percentile
Published
2024-04-10T18:56Z
EPSS history
Timeline
  • 10 APR 18:56Z
    spi: fix use-after-free of the add_lock mutex
    cvelistv5