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

Published Dec 3, 2026
·
Updated

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, sramrxbuf is left pointing to the freed buffer.

As a result, stm32spiunpreparemsg() may clear the released SRAM area, while stm32spiremove() or a later probe error path may free the buffer again, triggering BUGON() in genpoolfreeowner().

The probe error path also checks srampool instead of sramrxbuf. If the SRAM allocation failed and a later probe step fails, genpoolfree() may therefore be called with an unallocated buffer.

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

Affected Software

3 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.17.0<6.18.63
6.18.63
linux/kernel>=6.19.0<7.3.4
7.3.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 6.18.63
  2. Upgrade

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

    Fixed in 7.3.4
  3. Configuration

    On the MDMA fallback path, clear sram_rx_buf after freeing the SRAM buffer. In the probe error path, use sram_rx_buf to determine whether cleanup is needed instead of checking sram_pool.

    Linux kernel stm32 SPI driver sram_rx_buf = NULL after freeing

Event History

Dec 3, 2026
CVE Published
via MITRE·03:20 AM
Data Sourced
via MITRE·03:20 AM
Description
Data Sourced
via OSV·03:20 AM
DescriptionAffected Software
Data Sourced
via NVD·04:18 AM
Description

Frequently Asked Questions

1

Which systems are exposed to the affected cleanup paths?

Systems using the STM32 SPI driver are exposed when the driver cannot obtain the "rxm2m" MDMA channel and falls back to DMA-only mode. A separate affected probe-error path can occur when SRAM allocation fails and a later probe step also fails.

2

What failures can result from the stale or unallocated SRAM buffer handling?

The message-unprepare path may clear SRAM that was already released, and device removal or a later probe error path may free it again, triggering BUG_ON() in gen_pool_free_owner(). In the allocation-failure case, the probe error path may call gen_pool_free() for a buffer that was never allocated.

3

What remediation is available?

The vulnerability is resolved by clearing sram_rx_buf after it is freed during MDMA fallback and by checking sram_rx_buf, rather than sram_pool, before cleanup. The referenced stable kernel commits contain the fix.

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