summaryrefslogtreecommitdiff
path: root/scripts/dummy-tools/python3
diff options
context:
space:
mode:
authorWeibin Liu <liuwb@xiaopeng.com>2026-10-27 10:13:40 +0800
committerMark Brown <broonie@kernel.org>2026-11-01 23:40:54 +0000
commitaed0c7475d6af333fb9b37848ed5e4f92a808ffa (patch)
tree911c2515567ce01c15a9d08382b6fa0e4dd4eed9 /scripts/dummy-tools/python3
parent6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 (diff)
spi: amd: validate FIFO usage before executing message
The RX FIFO bound is checked in the drain loop, after amd_spi_execute_opcode(). A message whose cumulative RX length exceeds AMD_SPI_FIFO_SIZE can therefore issue an SPI transaction before being rejected. Check tx_len + rx_len while walking the message and drop the drain-loop check. This validates the complete message before executing the command. Tested with a user-space replica covering TX, RX and mixed messages at the 70/71-byte boundary. Oversized split-RX messages are now rejected without executing the command. No AMD SPI hardware was available. Assisted-by: LLM Suggested-by: Krishnamoorthi M <krishnamoorthi.m@amd.com> Fixes: e2f4edfc061e ("spi: amd: fix len==0 underflow and FIFO overflow") Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com> Signed-off-by: Weibin Liu <liuwb@xiaopeng.com> Link: https://patch.msgid.link/20261027021340.914399-1-liuwb@xiaopeng.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions