KernelScan.io

CRITICAL Introduced in 6.11

spi DmaMapping UAF

CVE-2026-90012

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.0HIGH

01

In the Linux kernel, the following vulnerability has been resolved: spi: Fix DMA mapping ownership on partial map failure If RX mapping fails after TX mapping succeeds, __spi_map_msg() unmaps TX but leaves tx_sg_mapped set. If TX mapping fails on a later transfer, mappings created for earlier transfers remain active. In both cases, cur_{tx,rx}_dma_dev have not yet been updated because they are assigned only after every transfer has been mapped. The subsequent spi_unmap_msg() may therefore unmap the TX mapping again or release earlier mappings using a NULL or stale device. Using a NULL device can trigger an oops. An empty SG table does not prevent the NULL dereference because dma_unmap_sg_attrs() accesses the device before checking the entry count. Publish both mapping devices before mapping starts and unwind all failures through __spi_unmap_msg(). This clears the mapping flags and releases each mapping once with the device that created it. Publishing the devices before the loop also refreshes them when no transfer needs mapping. No mapping flag is set in that case, so current users do not use the pointers as mapping owners.

02

Engine v0.6.0

Risk summary

This vulnerability in the SPI DMA mapping error path can cause a kernel oops or memory corruption when a DMA mapping fails during a multi-transfer SPI message. It affects any system with active SPI hardware where users or processes can initiate SPI transfers. The primary impact is denial of service through a kernel panic, though the double-unmap path could potentially lead to memory corruption.

Affecteddrivers/spi/spi.c (SPI subsystem)

Vulnerability analysis

When a DMA mapping fails partway through a multi-transfer SPI message, the error cleanup can leave mapping flags set after unmapping—causing a later double-unmap—or attempt to unmap using a NULL device pointer, triggering a kernel oops. The DMA device pointers are not recorded until all transfers have been mapped, so any failure before completion leaves them unset. The fix records both DMA device pointers before mapping begins and routes all partial-failure cleanup through the standard unmap path, ensuring each mapping is released exactly once with the correct device. The bug is reachable locally by any user or process that can initiate SPI transfers, such as through a spidev device node or a kernel driver, and requires a DMA mapping failure to occur, which can be induced through memory pressure.

03

BranchIntroducedFixed inPatch commit
7.26.117.2.55def8b6aaad4
mainline6.117.3-rc1367cea239fc9
6.186.116.18.51a38051fa2dde
6.126.116.12.110cc8354213ad6
cip/6.126.116.12.111-cip32cc8354213ad6