WSL2-Linux-Kernel/sound
Takashi Iwai e190161f96 ALSA: pcm: Fix tight loop of OSS capture stream
When the trigger=off is passed for a PCM OSS stream, it sets the
start_threshold of the given substream to the boundary size, so that
it won't be automatically started.  This can be problematic for a
capture stream, unfortunately, as detected by syzkaller.  The scenario
is like the following:

- In __snd_pcm_lib_xfer() that is invoked from snd_pcm_oss_read()
  loop, we have a check whether the stream was already started or the
  stream can be auto-started.
- The function at this check returns 0 with trigger=off since we
  explicitly disable the auto-start.
- The loop continues and repeats calling __snd_pcm_lib_xfer() tightly,
  which may lead to an RCU stall.

This patch fixes the bug by simply allowing the wait for non-started
stream in the case of OSS capture.  For native usages, it's supposed
to be done by the caller side (which is user-space), hence it returns
zero like before.

(In theory, __snd_pcm_lib_xfer() could wait even for the native API
 usage cases, too; but I'd like to stay in a safer side for not
 breaking the existing stuff for now.)

Reported-by: syzbot+fbe0496f92a0ce7b786c@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-25 19:45:46 +01:00
..
ac97
aoa ALSA: aoa: Use of_node_name_eq for node name comparisons 2018-12-06 10:54:54 +01:00
arm
atmel
core ALSA: pcm: Fix tight loop of OSS capture stream 2019-01-25 19:45:46 +01:00
drivers
firewire ALSA: bebob: fix model-id of unit for Apogee Ensemble 2018-12-19 14:36:35 +01:00
hda ALSA: HDA: export process_unsol_events() 2018-12-19 18:07:18 +01:00
i2c
isa Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
mips
oss
parisc
pci ALSA: hda - Add mute LED support for HP ProBook 470 G5 2019-01-21 15:31:04 +01:00
pcmcia
ppc ALSA: aoa: Use of_node_name_eq for node name comparisons 2018-12-06 10:54:54 +01:00
sh
soc ASoC: Fixes for v5.0 2019-01-18 15:17:17 +01:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2018-12-26 10:32:18 -08:00
spi
synth ALSA: emux: Fix potential Spectre v1 vulnerabilities 2018-12-13 09:13:04 +01:00
usb ALSA: usb-audio: Add Opus #3 to quirks for native DSD support 2019-01-25 19:45:42 +01:00
x86
xen ALSA: xen-front: Use Xen common shared buffer implementation 2018-12-18 12:19:37 -05:00
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c