linux-stable/sound
Kai Vehmanen ce1558c285 ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close
A race exists between closing a PCM and update of ELD data. In
hdmi_pcm_close(), hinfo->nid value is modified without taking
spec->pcm_lock. If this happens concurrently while processing an ELD
update in hdmi_pcm_setup_pin(), converter assignment may be done
incorrectly.

This bug was found by hitting a WARN_ON in snd_hda_spdif_ctls_assign()
in a HDMI receiver connection stress test:

[2739.684569] WARNING: CPU: 5 PID: 2090 at sound/pci/hda/patch_hdmi.c:1898 check_non_pcm_per_cvt+0x41/0x50 [snd_hda_codec_hdmi]
...
[2739.684707] Call Trace:
[2739.684720]  update_eld+0x121/0x5a0 [snd_hda_codec_hdmi]
[2739.684736]  hdmi_present_sense+0x21e/0x3b0 [snd_hda_codec_hdmi]
[2739.684750]  check_presence_and_report+0x81/0xd0 [snd_hda_codec_hdmi]
[2739.684842]  intel_audio_codec_enable+0x122/0x190 [i915]

Fixes: 42b2987079 ("ALSA: hda - hdmi playback without monitor in dynamic pcm bind mode")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201013152628.920764-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-10-13 18:34:35 +02:00
..
ac97 ALSA: ac97: (cosmetic) align argument names 2020-09-03 09:27:27 +02:00
aoa ALSA: aoa: i2sbus: use DECLARE_COMPLETION_ONSTACK() macro 2020-09-03 09:26:52 +02:00
arm
atmel ALSA: atmel: ac97: clarify operator precedence 2020-09-03 09:27:34 +02:00
core ALSA: seq: oss: Avoid mutex lock for a long-time ioctl 2020-09-23 14:45:14 +02:00
drivers ALSA: portman2x4: fix repeated word 'if' 2020-10-06 18:08:19 +02:00
firewire ALSA: fireworks: use semicolons rather than commas to separate statements 2020-10-12 08:51:51 +02:00
hda ASoC: Updates for v5.10 2020-10-12 16:08:57 +02:00
i2c
isa sound fixes for 5.9-rc2 2020-08-21 10:07:54 -07:00
mips
oss ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
parisc
pci ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close 2020-10-13 18:34:35 +02:00
pcmcia ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
ppc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sh
soc ASoC: Updates for v5.10 2020-10-12 16:08:57 +02:00
sparc ALSA: Replace HTTP links with HTTPS ones 2020-07-19 20:49:25 +02:00
spi
synth
usb Merge branch 'for-next' into for-linus 2020-10-12 08:51:00 +02:00
x86 ALSA: hda: use consistent HDAudio spelling in comments/docs 2020-09-02 19:31:32 +02:00
xen ALSA: xen: Remove superfluous fall through comments 2020-07-09 19:10:37 +02:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c