# CVE-2026-142843: spi: stm32: fix double free of SRAM buffer on MDMA fallback

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-12-03T03:20:53.702Z
- **Modified:** 2026-12-03T04:18:20.727Z

## Who should check

- Anyone running Linux \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 66cb7a60e0aa81c3426895ca1f98deb33411c47d; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< fa00fa501717427bd4335ec7261f7e668bdbb4ff; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 0c5b0c3eb1d6daa1117dacd32589196f52109cab
- Anyone running Linux 6.17

## Description

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

spi: stm32: fix double free of SRAM buffer on MDMA fallback

When the "rxm2m" MDMA channel cannot be obtained, the driver frees the
SRAM buffer and falls back to DMA-only mode. However, sram\_rx\_buf is
left pointing to the freed buffer.

As a result, stm32\_spi\_unprepare\_msg() may clear the released SRAM
area, while stm32\_spi\_remove() or a later probe error path may free the
buffer again, triggering BUG\_ON() in gen\_pool\_free\_owner().

The probe error path also checks sram\_pool instead of sram\_rx\_buf. If
the SRAM allocation failed and a later probe step fails,
gen\_pool\_free() may therefore be called with an unallocated buffer.

Clear sram\_rx\_buf after freeing it on the MDMA fallback path and use
the buffer pointer to determine whether cleanup is needed.

## Affected and fixed versions

- Linux: \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 66cb7a60e0aa81c3426895ca1f98deb33411c47d; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< fa00fa501717427bd4335ec7261f7e668bdbb4ff; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 0c5b0c3eb1d6daa1117dacd32589196f52109cab (cvelist)
- Linux: 6.17 (cvelist)

## Technologies

Linux kernel

## Mitigation

- Upgrade Linux to 0c5b0c3eb1d6daa1117dacd32589196f52109cab or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-142843. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-142843.md
Affected: Linux >= d17dd2f1d8a1d919e39c6302b024f135a2f90773, < 66cb7a60e0aa81c3426895ca1f98deb33411c47d; >= d17dd2f1d8a1d919e39c6302b024f135a2f90773, < fa00fa501717427bd4335ec7261f7e668bdbb4ff; >= d17dd2f1d8a1d919e39c6302b024f135a2f90773, < 0c5b0c3eb1d6daa1117dacd32589196f52109cab; Linux 6.17
Fixed in: Linux 66cb7a60e0aa81c3426895ca1f98deb33411c47d, Linux 0c5b0c3eb1d6daa1117dacd32589196f52109cab

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-142843 being exploited?

There is no confirmed exploitation: CVE-2026-142843 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-142843?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-142843?

Linux \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 66cb7a60e0aa81c3426895ca1f98deb33411c47d; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< fa00fa501717427bd4335ec7261f7e668bdbb4ff; \>= d17dd2f1d8a1d919e39c6302b024f135a2f90773, \< 0c5b0c3eb1d6daa1117dacd32589196f52109cab; Linux 6.17.

### Is there a fix for CVE-2026-142843?

Yes. Fixed in Linux 66cb7a60e0aa81c3426895ca1f98deb33411c47d, Linux 0c5b0c3eb1d6daa1117dacd32589196f52109cab. Upgrade Linux to 0c5b0c3eb1d6daa1117dacd32589196f52109cab or later.

### How do I check if I'm affected by CVE-2026-142843?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/66cb7a60e0aa81c3426895ca1f98deb33411c47d>
- other: <https://git.kernel.org/stable/c/fa00fa501717427bd4335ec7261f7e668bdbb4ff>
- other: <https://git.kernel.org/stable/c/0c5b0c3eb1d6daa1117dacd32589196f52109cab>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-142843>

HTML: <https://flawdb.com/CVE-2026-142843> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-142843>
