Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1322981
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: sound: WARNING in snd_rawmidi_kernel_write1 |
| Date | 2016-02-01 11:40 +0100 |
| Message-ID | <qXk3M-1dK-25@gated-at.bofh.it> (permalink) |
| References | <qXjKq-15d-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sound: WARNING in snd_rawmidi_kernel_write1 Dmitry Vyukov <dvyukov@google.com> - 2016-02-01 11:20 +0100
Re: sound: WARNING in snd_rawmidi_kernel_write1 Takashi Iwai <tiwai@suse.de> - 2016-02-01 11:40 +0100
Re: sound: WARNING in snd_rawmidi_kernel_write1 Dmitry Vyukov <dvyukov@google.com> - 2016-02-02 22:30 +0100
Re: sound: WARNING in snd_rawmidi_kernel_write1 Takashi Iwai <tiwai@suse.de> - 2016-02-03 00:30 +0100
Re: sound: WARNING in snd_rawmidi_kernel_write1 Dmitry Vyukov <dvyukov@google.com> - 2016-02-03 14:30 +0100
csiph-web