linux/sound/pci/hda
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
..
ca0132_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_auto_parser.c ALSA: hda: auto_parser: remove shadowed variable declaration 2020-09-03 09:27:00 +02:00
hda_auto_parser.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_beep.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
hda_beep.h ALSA: hda - Use standard device registration for beep 2019-01-29 18:28:09 +01:00
hda_bind.c ALSA: hda - Fix pending unsol events at shutdown 2019-10-28 12:44:28 +01:00
hda_codec.c ALSA: HDA: Early Forbid of runtime PM 2020-09-30 16:52:48 +02:00
hda_controller_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_controller.c ALSA: hda: Enable sync-write operation as default for all controllers 2020-06-19 12:05:02 +02:00
hda_controller.h Merge branch 'for-next' into for-linus 2020-08-03 08:10:08 +02:00
hda_eld.c ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs 2020-02-18 10:15:41 +01:00
hda_generic.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
hda_generic.h ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00
hda_hwdep.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_intel_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_intel.c ALSA: hda: fix jack detection with Realtek codecs when in D3 2020-10-12 13:00:22 +02:00
hda_intel.h ALSA: hda: Release resources at error in delayed probe 2020-04-13 18:02:36 +02:00
hda_jack.c ALSA: hda - Don't register a cb func if it is registered already 2020-09-30 12:56:32 +02:00
hda_jack.h ALSA: hda: (cosmetic) align function parameters 2020-09-03 09:27:11 +02:00
hda_local.h ALSA: hda: (cosmetic) align function parameters 2020-09-03 09:27:11 +02:00
hda_proc.c ALSA: hda: More constifications 2020-01-05 16:14:32 +01:00
hda_sysfs.c ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs 2020-02-18 10:15:41 +01:00
hda_tegra.c ALSA: hda/tegra: Program WAKEEN register for Tegra 2020-08-25 09:32:42 +02:00
hp_x360_helper.c ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakers 2018-05-29 22:33:37 +02:00
Kconfig ALSA: hda/hdmi: Add Intel silent stream support 2020-07-07 12:42:35 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
patch_analog.c ALSA: hda/analog - Minor optimization for SPDIF mux connections 2020-01-16 17:29:17 +01:00
patch_ca0110.c ALSA: hda: Unify get_response handling 2019-12-13 14:36:52 +01:00
patch_ca0132.c ALSA: hda: use semicolons rather than commas to separate statements 2020-10-12 08:51:19 +02:00
patch_cirrus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_cmedia.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_conexant.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
patch_hdmi.c ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close 2020-10-13 18:34:35 +02:00
patch_realtek.c ALSA: hda: fix jack detection with Realtek codecs when in D3 2020-10-12 13:00:22 +02:00
patch_si3054.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_sigmatel.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
patch_via.c ALSA: hda: Manage concurrent reg access more properly 2020-01-13 13:40:41 +01:00
thinkpad_helper.c ALSA: hda/realtek: Use the new vmaster mute LED helper 2020-06-18 13:23:49 +02:00