]> git.itanic.dy.fi Git - linux-stable/commit
ALSA: pcm: Add stream lock during PCM reset ioctl operations
authorTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2022 17:13:25 +0000 (18:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2022 07:57:09 +0000 (09:57 +0200)
commit0ae81ef3ea0e39950eb38a360f30f22d42ca3ddb
tree87b977bfe595377af1c2ba2e4c998fe767d3e0b7
parentb560d670c87d7d40b3cf6949246fa4c7aa65a00a
ALSA: pcm: Add stream lock during PCM reset ioctl operations

commit 1f68915b2efd0d6bfd6e124aa63c94b3c69f127c upstream.

snd_pcm_reset() is a non-atomic operation, and it's allowed to run
during the PCM stream running.  It implies that the manipulation of
hw_ptr and other parameters might be racy.

This patch adds the PCM stream lock at appropriate places in
snd_pcm_*_reset() actions for covering that.

Cc: <stable@vger.kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220322171325.4355-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm_native.c