From: Takashi Iwai <tiwai@suse.de>
To: "Dmitry Vyukov" <dvyukov@google.com>
Cc: <alsa-devel@alsa-project.org>, "Jaroslav Kysela" <perex@perex.cz>,
"LKML" <linux-kernel@vger.kernel.org>,
"Alexander Potapenko" <glider@google.com>,
"Kostya Serebryany" <kcc@google.com>,
"syzkaller" <syzkaller@googlegroups.com>,
"Sasha Levin" <sasha.levin@oracle.com>
Subject: Re: sound: WARNING in snd_rawmidi_kernel_write1
Date: Mon, 01 Feb 2016 11:36:59 +0100 [thread overview]
Message-ID: <s5hd1sgogxg.wl-tiwai@suse.de> (raw)
In-Reply-To: <CACT4Y+YfVJ3L+q0i-4vyQVyyPD7V=OMX0PWPi29x9Bo3QaBLdw@mail.gmail.com>
On Mon, 01 Feb 2016 11:15:08 +0100,
Dmitry Vyukov wrote:
>
> Hello,
>
> The following program triggers WARNING in snd_rawmidi_kernel_write1:
>
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <sys/uio.h>
> #include <fcntl.h>
>
> int main()
> {
> int fd;
> struct iovec iov;
>
> fd = open("/dev/snd/midiC3D0", O_RDWR);
What is the 3rd device? Please show /proc/asound/cards content.
> iov.iov_base = "";
> iov.iov_len = 0;
> writev(fd, &iov, 1);
> return 0;
> }
>
>
> ------------[ cut here ]------------
> WARNING: CPU: 1 PID: 27775 at sound/core/rawmidi.c:1181
The fix is easy, just remove snd_BUG_ON() like below.
thanks,
Takashi
---
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index a7759846fbaa..f75d1656272c 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1178,7 +1178,7 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream,
long count1, result;
struct snd_rawmidi_runtime *runtime = substream->runtime;
- if (snd_BUG_ON(!kernelbuf && !userbuf))
+ if (!kernelbuf && !userbuf)
return -EINVAL;
if (snd_BUG_ON(!runtime->buffer))
return -EINVAL;
next prev parent reply other threads:[~2016-02-01 10:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 10:15 Dmitry Vyukov
2016-02-01 10:36 ` Takashi Iwai [this message]
2016-02-02 21:25 ` Dmitry Vyukov
2016-02-02 23:20 ` Takashi Iwai
2016-02-03 13:23 ` Dmitry Vyukov
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=s5hd1sgogxg.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sasha.levin@oracle.com \
--cc=syzkaller@googlegroups.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
all inboxes | Powered by JetHome®