linux-stable/sound/usb/line6
Takashi Iwai bf670f94a3 ALSA: line6: Fix endless MIDI read loop
commit d683469b3c upstream.

The MIDI input event parser of the LINE6 driver may enter into an
endless loop when the unexpected data sequence is given, as it tries
to continue the secondary bytes without termination.  Also, when the
input data is too short, the parser returns a negative error, while
the caller doesn't handle it properly.  This would lead to the
unexpected behavior as well.

This patch addresses those issues by checking the return value
correctly and handling the one-byte event in the parser properly.

The bug was reported by syzkaller.

Reported-by: syzbot+cce32521ee0a824c21f7@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/000000000000033087059f8f8fa3@google.com
Link: https://lore.kernel.org/r/20200309095922.30269-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:09 +01:00
..
capture.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
capture.h ALSA: line6: make snd_pcm_ops const 2017-10-02 14:33:23 +02:00
driver.c ALSA: line6: Fix endless MIDI read loop 2020-03-25 08:06:09 +01:00
driver.h ALSA: line6: Assure canceling delayed work at disconnection 2019-06-09 09:17:17 +02:00
Kconfig ALSA: line6: snd-usb-line6 depends on CONFIG_SND_HWDEP 2016-09-21 14:36:22 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
midi.c ALSA: line6: Use correct endpoint type for midi output 2018-04-12 08:42:07 +02:00
midi.h ALSA: line6: Tidy up and typo fixes in comments 2015-01-28 20:54:43 +01:00
midibuf.c ALSA: line6: Fix endless MIDI read loop 2020-03-25 08:06:09 +01:00
midibuf.h ALSA: line6: Remove unused line6_midibuf_skip_message() 2015-02-01 09:35:25 +01:00
pcm.c ALSA: line6: Fix memory leak at line6_init_pcm() error path 2019-09-06 10:22:08 +02:00
pcm.h ALSA: line6: Add LINE6_CAP_IN_NEEDS_OUT, a void playback stream during capture 2016-09-19 23:00:37 +02:00
playback.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
playback.h ALSA: line6: make snd_pcm_ops const 2017-10-02 14:33:23 +02:00
pod.c ALSA: usb-audio: Convert timers to use timer_setup() 2017-10-17 10:52:22 +02:00
podhd.c ALSA: line6: Fix wrong altsetting for LINE6_PODHD500_1 2019-07-31 07:27:11 +02:00
toneport.c ALSA: line6: Assure canceling delayed work at disconnection 2019-06-09 09:17:17 +02:00
variax.c ALSA: usb-audio: Convert timers to use timer_setup() 2017-10-17 10:52:22 +02:00