ALSA: oss: Use kvzalloc() for local buffer allocations
authorTakashi Iwai <tiwai@suse.de>
Fri, 9 Nov 2018 10:59:45 +0000 (11:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:37:25 +0000 (09:37 +0100)
commit27d6abfb99c871b7c0179b52b6a23acc6c7c005b
treea35d0b7419a316fe66b6c254c840a4f97bcf3eaa
parentcc8b329fef53c74a4abf98b0755b3832d572d6ce
ALSA: oss: Use kvzalloc() for local buffer allocations

commit 65766ee0bf7fe8b3be80e2e1c3ef54ad59b29476 upstream.

PCM OSS layer may allocate a few temporary buffers, one for the core
read/write and another for the conversions via plugins.  Currently
both are allocated via vmalloc().  But as the allocation size is
equivalent with the PCM period size, the required size might be quite
small, depending on the application.

This patch replaces these vmalloc() calls with kvzalloc() for covering
small period sizes better.  Also, we use "z"-alloc variant here for
addressing the possible uninitialized access reported by syzkaller.

Reported-by: syzbot+1cb36954e127c98dd037@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/oss/pcm_oss.c
sound/core/oss/pcm_plugin.c