]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 24 Sep 2021 19:24:14 +0000 (14:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:49:08 +0000 (09:49 +0100)
commit68a57d48b10c7a96d5028124875e024de491d3eb
tree5c6672df72b9d6fac54f0f140bcae856d9d056a0
parent102535d7118ee20790e9b5f8332cf23905647d83
ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()

commit 1f6d69e97536506ef7ed595ab849f8ea29f60854 upstream.

The fields 'opened', 'running', 'assigned_key' are all protected by a
spinlock, but the spinlock is not taken when looking for a
stream. This can result in a possible race between assign() and
release().

Fix by taking the spinlock before walking through the bus stream list.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210924192417.169243-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Scott Bruce <smbruce@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/hda/hdac_stream.c