diff options
| author | Weibin Liu <liuwb@xiaopeng.com> | 2026-10-15 10:16:12 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-15 19:17:17 +0100 |
| commit | 9e44f0df3fff215d9033089e85980048c3ac132a (patch) | |
| tree | 643d75463488cc8d69466e319b320e6f8994a3c2 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | f0be928a41384ea93c876364f360779f70359249 (diff) | |
spi: bcm-qspi: reject oversized dummy bytes in mspi exec_mem_op
bcm_qspi_mspi_exec_mem_op() builds a local command buffer cmd[6]
holding one opcode byte, up to four address bytes and one spare
byte, and sets t[0].len = op->addr.nbytes + op->dummy.nbytes + 1.
bcm_qspi_exec_mem_op() only validates op->addr.nbytes <= 4 and never
bounds op->dummy.nbytes, which spi_mem_check_op() also leaves
unrestricted. With addr.nbytes = 4 and dummy.nbytes >= 2 the length
becomes 7 or more, so write_to_hw() reads past cmd[] on the kernel
stack and pushes the leaked bytes into the hardware TXRAM.
Reject operations whose dummy phase does not fit the remaining byte
of cmd[] by requiring op->dummy.nbytes <= 1, so such transfers fall
back to the generic SPI path instead of overrunning the buffer.
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Fixes: 5f195ee7d830c ("spi: bcm-qspi: Implement the spi_mem interface")
Cc: stable@vger.kernel.org # 4.18+
Signed-off-by: Weibin Liu <liuwb@xiaopeng.com>
Link: https://patch.msgid.link/20261015-bcm-qspi-dummy-bytes-v1-1-c319da3c2497@xiaopeng.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions
