spi: spi-zynqmp-gqspi: Resolved slab-out-of-bounds bug
authorAmit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Fri, 16 Apr 2021 00:46:50 +0000 (08:46 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 16 Apr 2021 12:44:13 +0000 (13:44 +0100)
commit2530b3df4326023a171977ab46fdfeac0340f5b2
tree0d2d7ac6658c973f96fbe78a43fc34c9fb8016b3
parent799f923f0a66a9c99f0a3eaa078b306db7a8b33a
spi: spi-zynqmp-gqspi: Resolved slab-out-of-bounds bug

During a transfer the driver filled the fifo with 4bytes,
even if the data that needs to be transfer is less that 4bytes.
This resulted in slab-out-of-bounds bug in KernelAddressSanitizer.

This patch resolves slab-out-of-bounds bug by filling the fifo
with the number of bytes that needs to transferred.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Link: https://lore.kernel.org/r/20210416004652.2975446-4-quanyang.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-zynqmp-gqspi.c