From: Jaroslav Kysela Date: Sat, 18 Dec 2021 12:39:25 +0000 (+0100) Subject: ALSA: rawmidi - fix the uninitalized user_pversion X-Git-Tag: accepted/tizen/unified/20230118.172025~3989 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b398fcbe4de1e1100867fdb6f447c6fbc8fe7085;p=platform%2Fkernel%2Flinux-rpi.git ALSA: rawmidi - fix the uninitalized user_pversion commit 39a8fc4971a00d22536aeb7d446ee4a97810611b upstream. The user_pversion was uninitialized for the user space file structure in the open function, because the file private structure use kmalloc for the allocation. The kernel ALSA sequencer code clears the file structure, so no additional fixes are required. Cc: stable@kernel.org Cc: broonie@kernel.org BugLink: https://github.com/alsa-project/alsa-lib/issues/178 Fixes: 09d23174402d ("ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION") Reported-by: syzbot+88412ee8811832b00dbe@syzkaller.appspotmail.com Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20211218123925.2583847-1-perex@perex.cz Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 6f30231..befa980 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -447,6 +447,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) err = -ENOMEM; goto __error; } + rawmidi_file->user_pversion = 0; init_waitqueue_entry(&wait, current); add_wait_queue(&rmidi->open_wait, &wait); while (1) {