CVE-2026-143405: spi: npcm-fiu: limit UMA data_size to the 16-byte staging buffer
In the Linux kernel, the following vulnerability has been resolved:
spi: npcm-fiu: limit UMA datasize to the 16-byte staging buffer
npcmfiuumaread() and npcmfiuumawrite() use a 16-byte on-stack staging buffer (u32 datareg[4]) and move datasize bytes to or from it. datasize comes straight from op->data.nbytes, which is supplied by the SPI MEM operation and is not bounded by the driver: npcmfiuexecop() only validates op->addr.nbytes, and no adjustopsize callback truncates the transfer to the controller FIFO size.
A SPI MEM operation with addr.nbytes == 0 and data.nbytes > 16 therefore overflows datareg[] on the kernel stack (write path) or reads past it (read path), corrupting the stack.
Reject datasize larger than the staging buffer in both UMA helpers by returning -EOPNOTSUPP, so spimem falls back to the generic SPI message path. The chunked path in npcmfiumanualwrite() always passes at most CHUNKSIZE bytes, so it is unaffected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In npcm_fiu_uma_read() and npcm_fiu_uma_write(), reject data_size values larger than the 16-byte staging buffer (u32 data_reg[4]).
Event History
Frequently Asked Questions
What conditions are required to trigger the vulnerable path?
The SPI MEM operation must have addr.nbytes set to 0 and data.nbytes greater than 16. The oversized data length reaches the UMA read or write helpers without being limited to their 16-byte on-stack staging buffer.
What is the impact of a successful trigger?
An oversized write can overflow the data_reg stack buffer, while an oversized read can read past it. Both conditions can corrupt kernel stack memory.
Is the driver's chunked manual-write path affected?
No. The npcm_fiu_manualwrite() chunked path passes no more than CHUNK_SIZE bytes and is identified as unaffected.
What happens after the fix when a transfer exceeds the staging-buffer size?
The UMA helpers reject data sizes larger than the staging buffer with -EOPNOTSUPP. spi_mem then falls back to the generic SPI message path.