diff options
| author | Weibin Liu <liuwb@xiaopeng.com> | 2026-09-29 16:11:44 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-14 16:43:38 +0100 |
| commit | ea9854a169e9c1437df8829bea21c2f2e80b137c (patch) | |
| tree | e2b248b1d41e16a6f4c3d215cddfc025d1eb7063 /tools/perf/scripts/python/bin | |
| parent | 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e (diff) | |
spi: cadence-xspi: reject SDMA transfers larger than the requested length
The XSPI controller reports the size of the slave-DMA transaction
through SDMA_SIZE_REG. Both SDMA handlers take this register at face
value and copy the reported number of bytes between the SDMA FIFO and
the transfer buffers, without checking it against the length of the
transfer that was actually requested.
While cdns_xspi_adjust_mem_op_size() clamps the size of the operations
issued by the SPI core, the device can still report a bigger SDMA size
than what was programmed, which makes the handlers read from or write
to memory beyond the end of the transfer buffers.
Track the number of bytes requested for the current data phase in a new
sdma_xfer_len field, set by cdns_xspi_send_stig_command() and by the
Marvell b0 transfer path, and reject any SDMA size that exceeds it.
Fixes: a16cc8077627 ("spi: cadence: add support for Cadence XSPI controller")
Cc: stable@vger.kernel.org # 5.16+
Signed-off-by: Weibin Liu <liuwb@xiaopeng.com>
Link: https://patch.msgid.link/20260929081146.41041-2-liuwb@xiaopeng.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
