Marc Kleine-Budde
b341c1176f
spi: spi-fsl-lpspi: fix teardown order issue (UAF)
...
There is a teardown order issue in the driver. The SPI controller is
registered using devm_spi_register_controller(), which delays
unregistration of the SPI controller until after the fsl_lpspi_remove()
function returns.
As the fsl_lpspi_remove() function synchronously tears down the DMA
channels, a running SPI transfer triggers the following NULL pointer
dereference due to use after free:
| fsl_lpspi 42550000.spi: I/O Error in DMA RX
| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[...]
| Call trace:
| fsl_lpspi_dma_transfer+0x260/0x340 [spi_fsl_lpspi]
| fsl_lpspi_transfer_one+0x198/0x448 [spi_fsl_lpspi]
| spi_transfer_one_message+0x49c/0x7c8
| __spi_pump_transfer_message+0x120/0x420
| __spi_sync+0x2c4/0x520
| spi_sync+0x34/0x60
| spidev_message+0x20c/0x378 [spidev]
| spidev_ioctl+0x398/0x750 [spidev]
[...]
Switch from devm_spi_register_controller() to spi_register_controller() in
fsl_lpspi_probe() and add the corresponding spi_unregister_controller() in
fsl_lpspi_remove().
Fixes: 5314987de5 ("spi: imx: add lpspi bus driver")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de >
Link: https://patch.msgid.link/20260319-spi-fsl-lpspi-fixes-v1-1-b433e435b2d8@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org >
2026-03-26 12:27:42 +00:00
..
2026-01-19 14:42:52 +00:00
2026-01-29 11:54:47 +00:00
2026-01-29 11:54:47 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2025-08-19 13:05:58 +01:00
2025-08-19 13:05:58 +01:00
2025-04-06 23:26:10 +01:00
2026-01-19 14:42:52 +00:00
2026-03-15 23:57:53 +00:00
2026-03-15 23:58:47 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-28 11:22:06 +00:00
2026-02-21 17:09:51 -08:00
2026-03-11 19:08:43 +00:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-16 00:28:54 +00:00
2026-01-09 13:21:55 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 20:03:00 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-03-10 14:32:38 +00:00
2026-01-27 12:46:29 +00:00
2026-01-28 11:22:06 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2024-02-08 11:54:50 +00:00
2025-11-28 11:48:08 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:51 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:54 +00:00
2026-02-21 17:09:51 -08:00
2026-03-02 22:33:32 +00:00
2026-01-28 11:58:11 +00:00
2025-10-13 11:27:35 +01:00
2025-10-13 11:27:35 +01:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2026-02-17 09:11:04 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-03-26 12:27:42 +00:00
2025-11-06 16:57:36 +00:00
2026-02-21 17:09:51 -08:00
2026-03-17 17:07:47 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 01:02:28 -08:00
2026-01-19 14:42:52 +00:00
2026-03-11 00:07:54 +00:00
2025-04-24 12:56:59 +01:00
2025-10-20 16:15:29 +01:00
2025-04-24 12:56:59 +01:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:54 +00:00
2025-08-12 12:06:13 +01:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-03-23 18:32:05 +00:00
2026-01-19 14:42:52 +00:00
2025-09-12 00:54:56 +01:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2025-08-18 13:13:57 +01:00
2025-10-13 11:27:52 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2025-06-30 12:15:45 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2026-03-09 19:10:21 +00:00
2026-01-20 17:58:31 +00:00
2025-09-22 09:21:18 +01:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:54 +00:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-03-23 14:51:59 +00:00
2026-01-28 11:22:06 +00:00
2026-01-19 14:42:52 +00:00
2026-01-06 12:23:36 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-02-26 23:16:12 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:54 +00:00
2026-01-19 14:42:53 +00:00
2026-01-19 14:42:52 +00:00
2026-02-11 09:43:43 -08:00
2026-02-21 17:09:51 -08:00
2026-02-11 09:43:43 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-01-19 14:42:52 +00:00
2026-02-21 20:03:00 -08:00
2026-02-13 17:08:24 +00:00
2026-01-19 14:42:52 +00:00
2026-02-03 21:06:18 +00:00
2026-01-19 14:42:52 +00:00
2026-01-19 14:42:52 +00:00
2025-07-05 00:50:32 +01:00
2026-03-26 10:45:28 +00:00
2026-02-21 17:09:51 -08:00