ALSA: rawmidi: Initialize allocated buffers
authorTakashi Iwai <tiwai@suse.de>
Mon, 3 Sep 2018 13:16:43 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:17:14 +0000 (08:17 +0200)
commite8e3fcbc66f608d38a72fc716ff45e31b7f3d123
treef187b6cd2e275a09949dd2a1bd9cd7115ac36232
parent4971520cd762ce9e4cad5ce16b30098c3ee4c0af
ALSA: rawmidi: Initialize allocated buffers

commit 5a7b44a8df822e0667fc76ed7130252523993bda upstream.

syzbot reported the uninitialized value exposure in certain situations
using virmidi loop.  It's likely a very small race at writing and
reading, and the influence is almost negligible.  But it's safer to
paper over this just by replacing the existing kvmalloc() with
kvzalloc().

Reported-by: syzbot+194dffdb8b22fc5d207a@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/rawmidi.c