]> git.ipfire.org Git - thirdparty/kernel/stable.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, 24 Apr 2020 05:58:52 +0000 (07:58 +0200)
commit8dc784d2ea15d3126710007b1971cfa638860e9d
tree6c0658aa72c94f1efd21c34fbc41de06f67a89c3
parent7d21de4b3be0ba001ba081c4d3508ff86f9a7699
ALSA: pcm: oss: Fix regression by buffer overflow fix

commit ae769d3556644888c964635179ef192995f40793 upstream.

The recent fix for the OOB access in PCM OSS plugins (commit
f2ecf903ef06: "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: f2ecf903ef06 ("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