summaryrefslogtreecommitdiffstats
path: root/net/sctp/ipv6.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-04-26 09:17:45 +0200
committerBen Hutchings <ben@decadent.org.uk>2018-10-21 08:45:47 +0100
commita26b9a4b32d3c299083476d500c51d52df867623 (patch)
treede4091651d26c2dc4eb67e7674d43f8a71e32a66 /net/sctp/ipv6.c
parentb822bbae88e3831c8279ef2da3fe044601d915bf (diff)
downloadlinux-stable-a26b9a4b32d3c299083476d500c51d52df867623.tar.gz
linux-stable-a26b9a4b32d3c299083476d500c51d52df867623.tar.bz2
linux-stable-a26b9a4b32d3c299083476d500c51d52df867623.zip
ALSA: seq: Fix races at MIDI encoding in snd_virmidi_output_trigger()
commit 8f22e52528cc372b218b5f100457469615c733ce upstream. The sequencer virmidi code has an open race at its output trigger callback: namely, virmidi keeps only one event packet for processing while it doesn't protect for concurrent output trigger calls. snd_virmidi_output_trigger() tries to process the previously unfinished event before starting encoding the given MIDI stream, but this is done without any lock. Meanwhile, if another rawmidi stream starts the output trigger, this proceeds further, and overwrites the event package that is being processed in another thread. This eventually corrupts and may lead to the invalid memory access if the event type is like SYSEX. The fix is just to move the spinlock to cover both the pending event and the new stream. The bug was spotted by a new fuzzer, RaceFuzzer. BugLink: http://lkml.kernel.org/r/20180426045223.GA15307@dragonet.kaist.ac.kr Reported-by: DaeRyong Jeong <threeearcat@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/sctp/ipv6.c')
0 files changed, 0 insertions, 0 deletions