Files
twx-linux/drivers
Lukas Wunner 483c8fa00e spi: spi-sh: Fix use-after-free on unbind
commit e77df3eca1 upstream.

spi_sh_remove() accesses the driver's private data after calling
spi_unregister_master() even though that function releases the last
reference on the spi_master 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: 680c1305e2 ("spi/spi_sh: use spi_unregister_master instead of spi_master_put in remove path")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <stable@vger.kernel.org> # v3.0+: 5e844cc37a: spi: Introduce device-managed SPI controller allocation
Cc: <stable@vger.kernel.org> # v3.0+
Cc: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/6d97628b536baf01d5e3e39db61108f84d44c8b2.1607286887.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-29 13:47:09 +01:00
..
…
2020-11-05 11:06:52 +01:00
2020-11-24 13:05:36 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
2020-11-05 11:06:55 +01:00
…
2020-12-29 13:47:03 +01:00
…
…
…
2020-12-29 13:47:02 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…