]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ASoC: topology: Prevent use-after-free in snd_soc_get_pcm_runtime()
authorDragos Tarcatu <dragos_tarcatu@mentor.com>
Wed, 4 Dec 2019 21:04:47 +0000 (15:04 -0600)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:52:39 +0000 (00:52 -0400)
commitef31c25715df17f62cf8f5cfb3b3f93d2072f619
treeb22dcf3bf94951152d5bbbad20c203d3c2d6f875
parent8fb6459a3ffb6ec9ef4262b314e50168cff48980
ASoC: topology: Prevent use-after-free in snd_soc_get_pcm_runtime()

BugLink: https://bugs.launchpad.net/bugs/1866403
[ Upstream commit dd836ddf4e4e1c7f1eb2ae44783ccd70872ef24e ]

remove_link() is currently calling snd_soc_remove_dai_link() after
it has already freed the memory for the link name. But this is later
read from snd_soc_get_pcm_runtime() causing a KASAN use-after-free
warning. Reorder the cleanups to fix this issue.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20191204210447.11701-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/soc/soc-topology.c