Commit ce1558c
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: 42b2987 ("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>1 parent f401b2c commit ce1558c
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2046 | 2046 | | |
2047 | 2047 | | |
2048 | 2048 | | |
| 2049 | + | |
2049 | 2050 | | |
2050 | 2051 | | |
2051 | | - | |
2052 | | - | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2053 | 2056 | | |
2054 | | - | |
2055 | | - | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
2056 | 2061 | | |
2057 | | - | |
2058 | 2062 | | |
2059 | 2063 | | |
2060 | 2064 | | |
2061 | 2065 | | |
2062 | 2066 | | |
2063 | 2067 | | |
2064 | | - | |
2065 | 2068 | | |
2066 | 2069 | | |
2067 | 2070 | | |
| |||
2091 | 2094 | | |
2092 | 2095 | | |
2093 | 2096 | | |
2094 | | - | |
2095 | | - | |
2096 | 2097 | | |
2097 | 2098 | | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
2098 | 2102 | | |
2099 | 2103 | | |
2100 | 2104 | | |
| |||
0 commit comments