mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
ALSA: line6: fix stack overflow in line6_midi_transmit
commit b8800d324a
upstream.
Correctly calculate available space including the size of the chunk
buffer. This fixes a buffer overflow when multiple MIDI sysex
messages are sent to a PODxt device.
Signed-off-by: Artem Egorkine <arteme@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221225105728.1153989-2-arteme@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e58d1d2eb3
commit
389d34c2a8
1 changed files with 2 additions and 1 deletions
|
@ -44,7 +44,8 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
|
|||
int req, done;
|
||||
|
||||
for (;;) {
|
||||
req = min(line6_midibuf_bytes_free(mb), line6->max_packet_size);
|
||||
req = min3(line6_midibuf_bytes_free(mb), line6->max_packet_size,
|
||||
LINE6_FALLBACK_MAXPACKETSIZE);
|
||||
done = snd_rawmidi_transmit_peek(substream, chunk, req);
|
||||
|
||||
if (done == 0)
|
||||
|
|
Loading…
Reference in a new issue