]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ALSA: hda: hdac_ext_stream: fix potential locking issues
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 24 Sep 2021 19:24:16 +0000 (14:24 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 11 Jan 2022 13:59:58 +0000 (14:59 +0100)
commit70e8e6fd0ed92f16c04e6dc79b3796cb77b4d38e
treebc3394c34b5c821dbb7d7b03801fb713c61c1a75
parent20d6a4480e0c8c5ea7145bd591293d78a2022da1
ALSA: hda: hdac_ext_stream: fix potential locking issues

BugLink: https://bugs.launchpad.net/bugs/1954834
commit 868ddfcef31ff93ea8961b2e81ea7fe12f6f144b upstream.

The code for hdac_ext_stream seems inherited from hdac_stream, and
similar locking issues are present: the use of the bus->reg_lock
spinlock is inconsistent, with only writes to specific fields being
protected.

Apply similar fix as in hdac_stream by protecting all accesses to
'link_locked' and 'decoupled' fields, with a new helper
snd_hdac_ext_stream_decouple_locked() added to simplify code
changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210924192417.169243-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/sound/hdaudio_ext.h
sound/hda/ext/hdac_ext_stream.c