]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Fix races among concurrent prealloc proc writes
authorTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2022 17:07:20 +0000 (18:07 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2022 19:56:58 +0000 (20:56 +0100)
commitd9ba391dc8386ead1de4ddaa25284fcb39993e6e
tree5dd87d340078126220bb58f2594d0550e9235155
parent9688ff8205d280de04b4093a2fec32fe481545e5
ALSA: pcm: Fix races among concurrent prealloc proc writes

We have no protection against concurrent PCM buffer preallocation
changes via proc files, and it may potentially lead to UAF or some
weird problem.  This patch applies the PCM open_mutex to the proc
write operation for avoiding the racy proc writes and the PCM stream
open (and further operations).

Cc: <stable@vger.kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220322170720.3529-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_memory.c