diff options
author | Lukas Wunner <lukas@wunner.de> | 2020-11-11 20:07:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-12 15:05:35 +0000 |
commit | e1483ac030fb4c57734289742f1c1d38dca61e22 (patch) | |
tree | 63c3622713b691047e276380889c671943d56203 /drivers/spi/spi-fsi.c | |
parent | 5e844cc37a5cbaa460e68f9a989d321d63088a89 (diff) |
spi: bcm2835: Fix use-after-free on unbind
bcm2835_spi_remove() accesses the driver's private data after calling
spi_unregister_controller() even though that function releases the last
reference on the spi_controller and thereby frees the private data.
Fix by switching over to the new devm_spi_alloc_master() helper which
keeps the private data accessible until the driver has unbound.
Fixes: f8043872e796 ("spi: add driver for BCM2835")
Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <stable@vger.kernel.org> # v3.10+: 123456789abc: spi: Introduce device-managed SPI controller allocation
Cc: <stable@vger.kernel.org> # v3.10+
Cc: Vladimir Oltean <olteanv@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/ad66e0a0ad96feb848814842ecf5b6a4539ef35c.1605121038.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsi.c')
0 files changed, 0 insertions, 0 deletions