diff options
| author | Weibin Liu <liuwb@xiaopeng.com> | 2026-10-13 11:17:17 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-13 20:42:20 +0100 |
| commit | 0fe4573c822c4c9152e2fd5269ab85410c9e458f (patch) | |
| tree | a174866e14b779afbbe0cbd6df2f35b3810d7078 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 3716c71d1c7783c6d731092403eb9f44c2a3a995 (diff) | |
spi: ljca: validate the response length before copying the data
ljca_spi_read_write() only checks that the response from the adapter
carries the packet header and a non-zero payload length before copying
r_packet->len bytes from the response into the transfer buffer.
The payload length is taken from the packet the device sent back and is
neither bounded by the number of bytes actually received nor by the
size of the requested transfer: a misbehaving adapter can announce a
payload larger than what it actually sent, and the memcpy then reads
past the end of the 60-byte input buffer and writes past the end of the
caller's transfer buffer.
Check that the response carries the full header before reading
r_packet->len, then reject responses whose payload is not contained in
the data received or is longer than the requested transfer.
Fixes: caee8e38da67 ("spi: Add support for Intel LJCA USB SPI driver")
Cc: stable@vger.kernel.org # 6.8+
Signed-off-by: Weibin Liu <liuwb@xiaopeng.com>
Link: https://patch.msgid.link/20261013031717.3933277-1-liuwb@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
