linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: syzbot <syzbot+88412ee8811832b00dbe@syzkaller.appspotmail.com>,
	alsa-devel@alsa-project.org, broonie@kernel.org, coding@diwic.se,
	colin.king@intel.com, glider@google.com, joe@perches.com,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	tiwai@suse.com
Subject: Re: [syzbot] KMSAN: uninit-value in snd_rawmidi_ioctl
Date: Sat, 18 Dec 2021 13:29:43 +0100	[thread overview]
Message-ID: <9603b40e-d038-1252-d613-8ece55029f07@perex.cz> (raw)
In-Reply-To: <0000000000004255b405d369cd72@google.com>

On 18. 12. 21 12:17, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    8b936c96768e kmsan: core: remove the accidentally committe..
> git tree:       https://github.com/google/kmsan.git master
> console output: https://syzkaller.appspot.com/x/log.txt?x=11791d89b00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=e00a8959fdd3f3e8
> dashboard link: https://syzkaller.appspot.com/bug?extid=88412ee8811832b00dbe
> compiler:       clang version 14.0.0 (git@github.com:llvm/llvm-project.git 0996585c8e3b3d409494eb5f1cad714b9e1f7fb5), GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13a7abf9b00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=172410b9b00000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+88412ee8811832b00dbe@syzkaller.appspotmail.com
> 
> =====================================================
> BUG: KMSAN: uninit-value in snd_rawmidi_ioctl+0xf1e/0x1330 sound/core/rawmidi.c:887
>   snd_rawmidi_ioctl+0xf1e/0x1330 sound/core/rawmidi.c:887

Nice catch. I wonder why the problem was not detected by tests. The patch 
bellow should initialize the user_pversion variable:

diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 6f30231bdb88..befa9809ff00 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) {

I'll send the path in the proper format ASAP.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

      reply	other threads:[~2021-12-18 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18 11:17 [syzbot] KMSAN: uninit-value in snd_rawmidi_ioctl syzbot
2021-12-18 12:29 ` Jaroslav Kysela [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9603b40e-d038-1252-d613-8ece55029f07@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=coding@diwic.se \
    --cc=colin.king@intel.com \
    --cc=glider@google.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+88412ee8811832b00dbe@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).