linux-stable/sound
Pierre-Louis Bossart 5660a6ffa7 ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak
commit 1f810d2b6b upstream.

The HDaudio stream allocation is done first, and in a second step the
LOSIDV parameter is programmed for the multi-link used by a codec.

This leads to a possible stream_tag leak, e.g. if a DisplayAudio link
is not used. This would happen when a non-Intel graphics card is used
and userspace unconditionally uses the Intel Display Audio PCMs without
checking if they are connected to a receiver with jack controls.

We should first check that there is a valid multi-link entry to
configure before allocating a stream_tag. This change aligns the
dma_assign and dma_cleanup phases.

Complements: b0cd60f3e9 ("ALSA/ASoC: hda: clarify bus_get_link() and bus_link_get() helpers")
Link: https://github.com/thesofproject/linux/issues/4151
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230216162340.19480-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-22 12:50:42 +01:00
..
ac97 ALSA: ac97: fix PM reference leak in ac97_bus_remove() 2021-07-20 16:10:42 +02:00
aoa ALSA: aoa: Fix I2S device accounting 2022-11-03 23:56:56 +09:00
arm
atmel
core ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF 2023-01-18 11:42:01 +01:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2023-01-18 11:41:09 +01:00
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-12 12:23:40 +02:00
hda ALSA: hda: add snd_hdac_stop_streams() helper 2023-01-18 11:41:39 +01:00
i2c
isa ALSA: wavefront: Proper check of get_user() error 2022-05-25 09:14:34 +02:00
mips
oss
parisc
pci ALSA: hda/realtek - fixed wrong gpio assigned 2023-02-22 12:50:39 +01:00
pcmcia
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:10:44 +02:00
sh
soc ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak 2023-02-22 12:50:42 +01:00
sparc
spi ALSA: spi: Add check for clk_enable() 2022-04-15 14:18:08 +02:00
synth ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-22 12:50:30 +01:00
usb ALSA: line6: fix stack overflow in line6_midi_transmit 2023-01-18 11:41:44 +01:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:07:46 +01:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c