android_kernel_oneplus_msm8998/sound/core
Takashi Iwai dc427decca 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>
2019-08-04 09:34:50 +02:00
..
oss ALSA: pcm: Fix possible OOB access in PCM oss plugins 2019-04-03 06:23:26 +02:00
seq ALSA: seq: Break too long mutex context in the write loop 2019-08-04 09:34:50 +02:00
compress_offload.c ALSA: compress: add support for 32bit calls in a 64bit kernel 2019-04-03 06:23:26 +02:00
control.c ALSA: control: Fix race between adding and removing a user element 2018-12-13 09:21:27 +01:00
control_compat.c ALSA: control: fix a redundant-copy issue 2018-05-26 08:48:52 +02:00
ctljack.c ALSA: jack: Fix endless loop at unique index detection 2015-06-26 06:59:57 +02:00
device.c
hrtimer.c ALSA: hrtimer: Fix stall by hrtimer_cancel() 2016-01-31 11:28:57 -08:00
hwdep.c
hwdep_compat.c
info.c ALSA: info: Fix racy addition/deletion of nodes 2019-04-27 09:34:02 +02:00
info_oss.c
init.c ALSA: core: Fix card races between register and disconnect 2019-04-27 09:34:01 +02:00
isadma.c
jack.c
Kconfig ALSA: timer: add config item to export PCM timer disabling for expert 2015-10-16 14:31:38 +02:00
Makefile ALSA: timer: add config item to export PCM timer disabling for expert 2015-10-16 14:31:38 +02:00
memalloc.c ALSA: memalloc: Don't exceed over the requested size 2018-08-22 07:48:36 +02:00
memory.c
misc.c
pcm.c ALSA: pcm: Fix potential Spectre v1 vulnerability 2019-01-13 10:05:29 +01:00
pcm_compat.c ALSA: pcm: Check PCM state at xfern compat ioctl 2018-05-16 10:06:47 +02:00
pcm_dmaengine.c
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c ALSA: pcm: remove SNDRV_PCM_IOCTL1_INFO internal command 2018-12-17 21:55:12 +01:00
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: PCM: check if ops are defined before suspending PCM 2019-04-27 09:33:51 +02:00
pcm_timer.c
pcm_trace.h
rawmidi.c ALSA: rawmidi: Fix potential Spectre v1 vulnerability 2019-04-03 06:23:26 +02:00
rawmidi_compat.c ALSA: rawmidi: Fix missing input substream checks in compat ioctls 2018-04-24 09:32:10 +02:00
rtctimer.c
sgbuf.c
sound.c
sound_oss.c
timer.c ALSA: timer: Fix zero-division by continue of uninitialized instance 2018-11-10 07:41:38 -08:00
timer_compat.c ALSA: timer: Remove kernel warning at compat ioctl error paths 2017-11-30 08:37:22 +00:00
vmaster.c ALSA: vmaster: Propagate slave error 2018-05-30 07:49:13 +02:00