]> 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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 28 Sep 2021 08:20:25 +0000 (10:20 +0200)
commit1f6d69e97536506ef7ed595ab849f8ea29f60854
tree042c8e47d7288fa496cd4158997243d54636d0ad
parent69b0c2457f5dfe225d7927b52ccab97ffd8aa6a5
ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()

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>
sound/hda/hdac_stream.c