]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: oss: Fix regression by buffer overflow fix
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Apr 2020 07:25:15 +0000 (09:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:07 +0000 (10:50 +0200)
commit5c8577791df0442e2a159c3522134c7ee240d707
tree7cb3fc96bc294003eaccdee14be97c296f8cd098
parent6044d8921982afbf4869e5845cd2d3904f860f6a
ALSA: pcm: oss: Fix regression by buffer overflow fix

commit 2e906b7966a8c99bd6eb3b193147a23bd36560e6 upstream.

The recent fix for the OOB access in PCM OSS plugins (commit
5028daa3ed6b: "ALSA: pcm: oss: Avoid plugin buffer overflow") caused a
regression on OSS applications.  The patch introduced the size check
in client and slave size calculations to limit to each plugin's buffer
size, but I overlooked that some code paths call those without
allocating the buffer but just for estimation.

This patch fixes the bug by skipping the size check for those code
paths while keeping checking in the actual transfer calls.

Fixes: 5028daa3ed6b ("ALSA: pcm: oss: Avoid plugin buffer overflow")
Tested-and-reported-by: Jari Ruusu <jari.ruusu@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200403072515.25539-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/oss/pcm_plugin.c