ALSA: pcm: Fix races among concurrent prealloc proc writes
stable inclusion from linux-4.19.243 commit e14dca613e0a6ddc2bf6e360f16936a9f865205b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I50WAS CVE: CVE-2022-1048 -------------------------------- commit 69534c48 upstream. 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> [OP: backport to 4.19: adjusted context] Signed-off-by:
Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Rui Xiang <rui.xiang@huawei.com> Reviewed-by:
zhangxiaoxu <zhangxiaoxu5@huawei.com> Reviewed-by:
Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment