]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: topology: fix oops/use-after-free case with dai driver
authorGuennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Fri, 1 Feb 2019 17:05:13 +0000 (11:05 -0600)
committerMark Brown <broonie@kernel.org>
Sat, 2 Feb 2019 16:13:28 +0000 (17:13 +0100)
commita61616de66ce5d16ca50e1566e10f72c2b2a30e7
treee003e0a1cc378513a2a3cfc505f373a40d42b069
parent0a4875b9b8f7290bf4ec422cdb0d34bef5bc0e5a
ASoC: topology: fix oops/use-after-free case with dai driver

rmmod/modprobe tests expose a kernel oops when accessing the dai
driver pointer. This comes from the topology design which operates in
multiple passes. Each object removal happens at a specific iteration,
and the code checks for the iteration (order) number after the memory
containing the order was freed.

Fix this be clearing a reference to the dai driver and check its
validity to avoid dereferences.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c
sound/soc/soc-topology.c