linux-stable/sound
Yang Yingliang 390a1a9828 ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove()
[ Upstream commit 1b41beaa7a ]

sof_es8336_remove() calls cancel_delayed_work(). However, that
function does not wait until the work function finishes. This
means that the callback function may still be running after
the driver's remove function has finished, which would result
in a use-after-free.

Fix by calling cancel_delayed_work_sync(), which ensures that
the work is properly cancelled, no longer running, and unable
to re-schedule itself.

Fixes: 89cdb224f2 ("ASoC: sof_es8336: reduce pop noise on speaker")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221205143721.3988988-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:33:06 +01:00
..
ac97
aoa ALSA: aoa: Fix I2S device accounting 2022-10-27 08:53:08 +02:00
arm ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq() 2022-10-29 10:45:27 +02:00
atmel
core ALSA: pcm: Set missing stop_operating flag at undoing trigger start 2022-12-31 13:32:22 +01:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2022-12-31 13:32:22 +01:00
firewire ALSA: dice: fix regression for Lexicon I-ONIX FW810S 2022-11-30 16:15:02 +01:00
hda ASoC: Fixes for v6.1 2022-11-12 09:52:24 +01:00
i2c
isa ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it 2022-09-29 08:11:55 +02:00
mips
oss sound: oss: dmasound: remove software_input_volume declaration 2022-09-09 09:11:06 +02:00
parisc
pci ALSA: asihpi: fix missing pci_disable_device() 2022-12-31 13:32:18 +01:00
pcmcia
ppc sound updates for 6.1-rc1 2022-10-05 12:02:07 -07:00
sh
soc ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove() 2022-12-31 13:33:06 +01:00
sparc
spi
synth ALSA: Use del_timer_sync() before freeing timer 2022-10-27 08:42:08 +02:00
usb ALSA: usb-audio: Add quirk for Tascam Model 12 2022-12-31 13:33:03 +01:00
virtio
x86
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c