{"id":"CVE-2026-142843","summary":"spi: stm32: fix double free of SRAM buffer on MDMA fallback","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: stm32: fix double free of SRAM buffer on MDMA fallback\n\nWhen the \"rxm2m\" MDMA channel cannot be obtained, the driver frees the\nSRAM buffer and falls back to DMA-only mode. However, sram_rx_buf is\nleft pointing to the freed buffer.\n\nAs a result, stm32_spi_unprepare_msg() may clear the released SRAM\narea, while stm32_spi_remove() or a later probe error path may free the\nbuffer again, triggering BUG_ON() in gen_pool_free_owner().\n\nThe probe error path also checks sram_pool instead of sram_rx_buf. If\nthe SRAM allocation failed and a later probe step fails,\ngen_pool_free() may therefore be called with an unallocated buffer.\n\nClear sram_rx_buf after freeing it on the MDMA fallback path and use\nthe buffer pointer to determine whether cleanup is needed.","modified":"2026-12-03T05:00:49.601506722Z","published":"2026-12-03T03:20:53.702Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142843.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/0c5b0c3eb1d6daa1117dacd32589196f52109cab"},{"type":"WEB","url":"https://git.kernel.org/stable/c/66cb7a60e0aa81c3426895ca1f98deb33411c47d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/fa00fa501717427bd4335ec7261f7e668bdbb4ff"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142843.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142843"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d17dd2f1d8a1d919e39c6302b024f135a2f90773"},{"fixed":"66cb7a60e0aa81c3426895ca1f98deb33411c47d"},{"fixed":"fa00fa501717427bd4335ec7261f7e668bdbb4ff"},{"fixed":"0c5b0c3eb1d6daa1117dacd32589196f52109cab"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142843.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.17.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142843.json"}}],"schema_version":"1.9.2"}