CVE-2024-26807
Severity CVSS v4.0:
Pending analysis
Type:
CWE-787
Out-of-bounds Write
Publication date:
04/04/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
Both cadence-quadspi ->runtime_suspend() and ->runtime_resume()<br />
implementations start with:<br />
<br />
struct cqspi_st *cqspi = dev_get_drvdata(dev);<br />
struct spi_controller *host = dev_get_drvdata(dev);<br />
<br />
This obviously cannot be correct, unless "struct cqspi_st" is the<br />
first member of " struct spi_controller", or the other way around, but<br />
it is not the case. "struct spi_controller" is allocated by<br />
devm_spi_alloc_host(), which allocates an extra amount of memory for<br />
private data, used to store "struct cqspi_st".<br />
<br />
The ->probe() function of the cadence-quadspi driver then sets the<br />
device drvdata to store the address of the "struct cqspi_st"<br />
structure. Therefore:<br />
<br />
struct cqspi_st *cqspi = dev_get_drvdata(dev);<br />
<br />
is correct, but:<br />
<br />
struct spi_controller *host = dev_get_drvdata(dev);<br />
<br />
is not, as it makes "host" point not to a "struct spi_controller" but<br />
to the same "struct cqspi_st" structure as above.<br />
<br />
This obviously leads to bad things (memory corruption, kernel crashes)<br />
directly during ->probe(), as ->probe() enables the device using PM<br />
runtime, leading the ->runtime_resume() hook being called, which in<br />
turns calls spi_controller_resume() with the wrong pointer.<br />
<br />
This has at least been reported [0] to cause a kernel crash, but the<br />
exact behavior will depend on the memory contents.<br />
<br />
[0] https://lore.kernel.org/all/20240226121803.5a7r5wkpbbowcxgx@dhruva/<br />
<br />
This issue potentially affects all platforms that are currently using<br />
the cadence-quadspi driver.
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:*:*:*:*:*:*:*:* | 6.4 (including) | 6.6.21 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.7.9 (excluding) |
| cpe:2.3:o:linux:linux_kernel:4.19.283:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.4.243:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.10.180:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15.111:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.1.28:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.2.15:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.3.2:*:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/03f1573c9587029730ca68503f5062105b122f61
- https://git.kernel.org/stable/c/2c914aac9522f6e93822c18dff233d3e92399c81
- https://git.kernel.org/stable/c/32ce3bb57b6b402de2aec1012511e7ac4e7449dc
- https://git.kernel.org/stable/c/34e1d5c4407c78de0e3473e1fbf8fb74dbe66d03
- https://git.kernel.org/stable/c/03f1573c9587029730ca68503f5062105b122f61
- https://git.kernel.org/stable/c/32ce3bb57b6b402de2aec1012511e7ac4e7449dc
- https://git.kernel.org/stable/c/34e1d5c4407c78de0e3473e1fbf8fb74dbe66d03
- https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html



