]> 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)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Apr 2020 07:25:52 +0000 (09:25 +0200)
commit1d86aebfb917326ecd889c729163c2951cce8fd5
tree1b30b4bf948adea3d9e4379679eb4fb92d115d40
parent9503ca886e0007ac43d15aeaf3350b479a6d6b8b
ALSA: pcm: oss: Fix regression by buffer overflow fix

The recent fix for the OOB access in PCM OSS plugins (commit
2a86cec927f1: "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: 2a86cec927f1 ("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>
sound/core/oss/pcm_plugin.c