OrangePi_CM5/drivers/spi
Marek Szyprowski d9e25dc053 spi: Ensure that sg_table won't be used after being freed
[ Upstream commit 8e9204cddcc3fea9affcfa411715ba4f66e97587 ]

SPI code checks for non-zero sgt->orig_nents to determine if the buffer
has been DMA-mapped. Ensure that sg_table is really zeroed after free to
avoid potential NULL pointer dereference if the given SPI xfer object is
reused again without being DMA-mapped.

Fixes: 0c17ba73c08f ("spi: Fix cache corruption due to DMA/PIO overlap")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20220930113408.19720-1-m.szyprowski@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:23 +02:00
..
Kconfig
…
Makefile
…
atmel-quadspi.c spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller 2022-04-27 13:53:57 +02:00
internals.h
…
spi-altera.c
…
spi-amd.c spi: amd: Limit max transfer and message size 2022-07-21 21:20:03 +02:00
spi-ar934x.c
…
spi-armada-3700.c spi: change clk_disable_unprepare to clk_unprepare 2021-12-29 12:25:54 +01:00
spi-at91-usart.c
…
spi-ath79.c
…
spi-atmel.c
…
spi-au1550.c
…
spi-axi-spi-engine.c
…
spi-bcm-qspi.c spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() 2022-04-13 21:01:06 +02:00
spi-bcm-qspi.h
…
spi-bcm63xx-hsspi.c
…
spi-bcm63xx.c
…
spi-bcm2835.c spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers 2022-07-29 17:19:23 +02:00
spi-bcm2835aux.c
…
spi-bitbang-txrx.h
…
spi-bitbang.c
…
spi-brcmstb-qspi.c
…
spi-butterfly.c
…
spi-cadence-quadspi.c
…
spi-cadence.c spi: cadence: Correct initialisation of runtime PM again 2021-07-28 14:35:39 +02:00
spi-cavium-octeon.c
…
spi-cavium-thunderx.c
…
spi-cavium.c
…
spi-cavium.h
…
spi-clps711x.c
…
spi-coldfire-qspi.c spi: coldfire-qspi: Use clk_disable_unprepare in the remove function 2021-09-15 09:50:29 +02:00
spi-davinci.c spi: davinci: invoke chipselect callback 2021-09-15 09:50:30 +02:00
spi-dln2.c
…
spi-dw-bt1.c spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe 2022-10-26 13:25:21 +02:00
spi-dw-core.c
…
spi-dw-dma.c
…
spi-dw-mmio.c
…
spi-dw-pci.c
…
spi-dw.h
…
spi-efm32.c
…
spi-ep93xx.c
…
spi-falcon.c
…
spi-fsi.c
…
spi-fsl-cpm.c
…
spi-fsl-cpm.h
…
spi-fsl-dspi.c spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-fsl-espi.c
…
spi-fsl-lib.c
…
spi-fsl-lib.h
…
spi-fsl-lpspi.c
…
spi-fsl-qspi.c spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname() 2022-06-09 10:21:06 +02:00
spi-fsl-spi.c
…
spi-fsl-spi.h
…
spi-geni-qcom.c
…
spi-gpio.c
…
spi-hisi-sfc-v3xx.c
…
spi-img-spfi.c spi: img-spfi: Fix pm_runtime_get_sync() error checking 2022-06-09 10:21:02 +02:00
spi-imx.c spi: imx: mx51-ecspi: Fix low-speed CONFIGREG delay calculation 2021-08-12 13:22:04 +02:00
spi-iproc-qspi.c
…
spi-jcore.c
…
spi-lantiq-ssc.c
…
spi-lm70llp.c
…
spi-loopback-test.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
spi-lp8841-rtc.c
…
spi-mem.c
…
spi-meson-spicc.c spi: meson-spicc: do not rely on busy flag in pow2 clk ops 2022-10-26 13:25:20 +02:00
spi-meson-spifc.c spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe 2022-01-27 10:54:03 +01:00
spi-mpc52xx-psc.c
…
spi-mpc52xx.c
…
spi-mpc512x-psc.c
…
spi-mt65xx.c spi: mediatek: Avoid NULL pointer crash in interrupt 2022-02-08 18:30:37 +01:00
spi-mt7621.c spi: mt7621: Fix an error message in mt7621_spi_probe() 2022-10-26 13:25:19 +02:00
spi-mtk-nor.c spi: spi-mtk-nor: initialize spi controller after resume 2022-04-27 13:53:48 +02:00
spi-mux.c spi: spi-mux: Add module info needed for autoloading 2021-08-26 08:35:35 -04:00
spi-mxic.c spi: mxic: Fix the transmit path 2022-04-08 14:39:51 +02:00
spi-mxs.c
…
spi-npcm-fiu.c
…
spi-npcm-pspi.c
…
spi-nxp-fspi.c
…
spi-oc-tiny.c
…
spi-omap-100k.c spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe 2022-10-26 13:25:22 +02:00
spi-omap-uwire.c
…
spi-omap2-mcspi.c
…
spi-orion.c
…
spi-pic32-sqi.c
…
spi-pic32.c spi: spi-pic32: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-pl022.c amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
spi-ppc4xx.c
…
spi-pxa2xx-dma.c
…
spi-pxa2xx-pci.c spi: pxa2xx-pci: Balance reference count for PCI DMA device 2022-04-08 14:40:00 +02:00
spi-pxa2xx.c
…
spi-pxa2xx.h
…
spi-qcom-qspi.c
…
spi-qup.c spi: qup: add missing clk_disable_unprepare on error in spi_qup_pm_resume_runtime() 2022-10-26 13:25:20 +02:00
spi-rb4xx.c
…
spi-rockchip.c spi: rockchip: terminate dma transmission when slave abort 2022-03-16 14:16:00 +01:00
spi-rpc-if.c spi: spi-rpc-if: Check return value of rpcif_sw_init() 2021-11-18 14:04:11 +01:00
spi-rspi.c spi: spi-rspi: Fix PIO fallback on RZ platforms 2022-08-21 15:15:31 +02:00
spi-s3c24xx-regs.h
…
spi-s3c24xx.c
…
spi-s3c64xx.c spi: s3c64xx: Fix large transfers with DMA 2022-10-26 13:25:22 +02:00
spi-sc18is602.c
…
spi-sh-hspi.c
…
spi-sh-msiof.c
…
spi-sh-sci.c
…
spi-sh.c
…
spi-sifive.c
…
spi-sirf.c
…
spi-slave-mt27xx.c
…
spi-slave-system-control.c
…
spi-slave-time.c
…
spi-sprd-adi.c spi: sprd: Fix the wrong WDG_LOAD_VAL 2021-09-15 09:50:30 +02:00
spi-sprd.c
…
spi-st-ssc4.c
…
spi-stm32-qspi.c spi: stm32-qspi: Fix wait_cmd timeout in APM mode 2022-06-09 10:20:54 +02:00
spi-stm32.c spi: stm32h7: fix full duplex irq handler handling 2021-08-08 09:05:22 +02:00
spi-sun4i.c
…
spi-sun6i.c spi: spi-sun6i: Fix chipselect/clock bug 2021-07-14 16:56:10 +02:00
spi-synquacer.c spi: synquacer: Add missing clk_disable_unprepare() 2022-08-21 15:15:30 +02:00
spi-tegra20-sflash.c
…
spi-tegra20-slink.c spi: tegra20: Use of_device_get_match_data() 2022-04-08 14:40:32 +02:00
spi-tegra114.c spi: tegra114: Add missing IRQ check in tegra_spi_probe 2022-04-08 14:39:59 +02:00
spi-test.h
…
spi-ti-qspi.c spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout 2022-06-09 10:21:01 +02:00
spi-tle62x0.c
…
spi-topcliff-pch.c spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages() 2021-07-14 16:55:50 +02:00
spi-txx9.c
…
spi-uniphier.c spi: uniphier: fix reference count leak in uniphier_spi_probe() 2022-02-08 18:30:37 +01:00
spi-xcomm.c
…
spi-xilinx.c
…
spi-xlp.c
…
spi-xtensa-xtfpga.c
…
spi-zynq-qspi.c spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op() 2022-03-02 11:42:52 +01:00
spi-zynqmp-gqspi.c spi: spi-zynqmp-gqspi: Handle error for dma_set_mask 2022-04-08 14:40:01 +02:00
spi.c spi: Ensure that sg_table won't be used after being freed 2022-10-26 13:25:23 +02:00
spidev.c
…