CVE-2024-26807: spi: cadence-qspi: fix pointer reference in runtime PM hooks

Published Apr 4, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

Both cadence-quadspi ->runtimesuspend() and ->runtimeresume() implementations start with:

struct cqspist cqspi = devgetdrvdata(dev); struct spicontroller host = devgetdrvdata(dev);

This obviously cannot be correct, unless "struct cqspist" is the first member of " struct spicontroller", or the other way around, but it is not the case. "struct spicontroller" is allocated by devmspiallochost(), which allocates an extra amount of memory for private data, used to store "struct cqspist".

The ->probe() function of the cadence-quadspi driver then sets the device drvdata to store the address of the "struct cqspist" structure. Therefore:

struct cqspist cqspi = devgetdrvdata(dev);

is correct, but:

struct spicontroller host = devgetdrvdata(dev);

is not, as it makes "host" point not to a "struct spicontroller" but to the same "struct cqspist" structure as above.

This obviously leads to bad things (memory corruption, kernel crashes) directly during ->probe(), as ->probe() enables the device using PM runtime, leading the ->runtimeresume() hook being called, which in turns calls spicontrollerresume() with the wrong pointer.

This has at least been reported [0] to cause a kernel crash, but the exact behavior will depend on the memory contents.

[0] https://lore.kernel.org/all/20240226121803.5a7r5wkpbbowcxgx@dhruva/

This issue potentially affects all platforms that are currently using the cadence-quadspi driver.

Affected Software

157 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.4<6.6.21
Linux Linux kernel>=6.7<6.7.9
Linux Linux kernel=4.19.283
Linux Linux kernel=5.4.243
Linux Linux kernel=5.10.180
Linux Linux kernel=5.15.111
Linux Linux kernel=6.1.28
Linux Linux kernel=6.2.15
Linux Linux kernel=6.3.2
Linux Linux kernel=6.8-rc1
Linux Linux kernel=6.8-rc2
Linux Linux kernel=6.8-rc3
Linux Linux kernel=6.8-rc4
Linux Linux kernel=6.8-rc5
Linux Linux kernel=6.8-rc6
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-aws-5.4*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-5.4*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gcp-5.4*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-5.4*
ubuntu/linux-ibm-5.4*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-oracle-5.4*
ubuntu/linux-raspi-5.4*
ubuntu/linux*
ubuntu/linux-aws*
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.15*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.15*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-azure-fde-5.15*
ubuntu/linux-bluefield*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.15*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.15*
ubuntu/linux-hwe-5.8*
ubuntu/linux-ibm*
ubuntu/linux-ibm-5.15*
ubuntu/linux-intel-5.13*
ubuntu/linux-intel-iotg-5.15*
ubuntu/linux-iot*
ubuntu/linux-kvm*
ubuntu/linux-lowlatency-hwe-5.15*
ubuntu/linux-nvidia-tegra-5.15*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.15*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.15*
ubuntu/linux-riscv-5.8*
ubuntu/linux-xilinx-zynqmp*
ubuntu/linux-aws-fips*
ubuntu/linux-azure-fips*
ubuntu/linux-fips*
ubuntu/linux-gcp-fips*
ubuntu/linux*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-azure*
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-fde*
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-gke*
ubuntu/linux-gkeop*
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-ibm*
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-intel-iotg*
ubuntu/linux-kvm*
ubuntu/linux-lowlatency*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-nvidia*
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-nvidia-tegra*
ubuntu/linux-nvidia-tegra-igx*
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle*
ubuntu/linux-oracle-6.5*
ubuntu/linux-raspi*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-xilinx-zynqmp*
ubuntu/linux-bluefield*
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-realtime*
ubuntu/linux-aws-fips*
ubuntu/linux-azure-fips*
ubuntu/linux-gcp-fips*
ubuntu/linux-aws-fips*
ubuntu/linux-azure-fips*
ubuntu/linux-fips*
ubuntu/linux-gcp-fips*
ubuntu/linux-raspi-realtime<6.8.0-2002.2
6.8.0-2002.2
debian/linux<6.1.140-1
6.1.140-1
debian/linux<6.7.9-1
6.7.9-1
debian/linux<6.7.9-1
6.7.9-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/linux-raspi-realtime to a version that resolves this vulnerability.

    Fixed in 6.8.0-2002.2
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.140-1
  3. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.7.9-1
  4. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1

Event History

Apr 4, 2024
CVE Published
via MITRE·08:20 AM
Data Sourced
via MITRE·08:20 AM
DescriptionSeverity
Data Sourced
via OSV·09:15 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·09:15 AM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-26807?

The severity of CVE-2024-26807 is classified depending on the specific impact it could have on the Linux kernel, typical evaluations consider factors like potential data loss or unauthorized access.

2

How do I fix CVE-2024-26807?

To fix CVE-2024-26807, you should update your Linux kernel to the latest patched version that addresses this vulnerability.

3

What systems are affected by CVE-2024-26807?

CVE-2024-26807 affects various versions of the Linux kernel that implement certain aspects of the cadence-quadspi SPI controller.

4

What is the nature of the vulnerability CVE-2024-26807?

CVE-2024-26807 is related to improper handling in the cadence-quadspi module during runtime suspend and resume processes.

5

Are there any known exploits for CVE-2024-26807?

As of now, there are no widely reported or known exploits specifically targeting CVE-2024-26807 in the wild.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203