android_kernel_samsung_a7y1.../sound
Takashi Iwai 99964b0697 ALSA: seq: Break too long mutex context in the write loop
commit ede34f397ddb063b145b9e7d79c6026f819ded13 upstream.

The fix for the racy writes and ioctls to sequencer widened the
application of client->ioctl_mutex to the whole write loop.  Although
it does unlock/relock for the lengthy operation like the event dup,
the loop keeps the ioctl_mutex for the whole time in other
situations.  This may take quite long time if the user-space would
give a huge buffer, and this is a likely cause of some weird behavior
spotted by syzcaller fuzzer.

This patch puts a simple workaround, just adding a mutex break in the
loop when a large number of events have been processed.  This
shouldn't hit any performance drop because the threshold is set high
enough for usual operations.

Fixes: 7bd800915677 ("ALSA: seq: More protection for concurrent write and ioctl races")
Reported-by: syzbot+97aae04ce27e39cbfca9@syzkaller.appspotmail.com
Reported-by: syzbot+4c595632b98bb8ffcc66@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 20:04:17 +02:00
..
aoa A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
arm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
atmel A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core ALSA: seq: Break too long mutex context in the write loop 2020-04-06 20:04:17 +02:00
drivers ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration 2020-04-06 15:17:05 +02:00
firewire ALSA: firewire-lib/fireworks: fix miss detection of received MIDI messages 2020-04-06 19:21:02 +02:00
hda A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
i2c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
isa ALSA: sb8: add a check for request_region 2020-04-06 15:16:58 +02:00
mips A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
oss A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
parisc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci ALSA: hda - Register irq handler after the chip initialization 2020-04-06 19:02:01 +02:00
pcmcia A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ppc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
soc ASoC: max98090: remove 24-bit format support if RJ is 0 2020-04-06 19:17:45 +02:00
sparc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
spi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
synth A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usb ALSA: usb-audio: fix sign unintended sign extension on left shifts 2020-04-06 19:21:04 +02:00
ac97_bus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
last.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sound_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sound_firmware.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30