WSL2-Linux-Kernel/sound/core
Takashi Iwai 83f0ba8592 ALSA: timer: Set lower bound of start tick time
commit 4a63bd179fa8d3fcc44a0d9d71d941ddd62f0c4e upstream.

Currently ALSA timer doesn't have the lower limit of the start tick
time, and it allows a very small size, e.g. 1 tick with 1ns resolution
for hrtimer.  Such a situation may lead to an unexpected RCU stall,
where  the callback repeatedly queuing the expire update, as reported
by fuzzer.

This patch introduces a sanity check of the timer start tick time, so
that the system returns an error when a too small start size is set.
As of this patch, the lower limit is hard-coded to 100us, which is
small enough but can still work somehow.

Reported-by: syzbot+43120c2af6ca2938cc38@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/000000000000fa00a1061740ab6d@google.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240514182745.4015-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ backport note: the error handling is changed, as the original commit
  is based on the recent cleanup with guard() in commit beb45974dd49
  -- tiwai ]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:39:52 +02:00
..
oss ALSA: oss: avoid missing-prototype warnings 2023-06-09 10:32:26 +02:00
seq ALSA: seq: fix function cast warnings 2024-03-26 18:21:27 -04:00
Kconfig
Makefile ALSA: Drop leftover snd-rtctimer stuff from Makefile 2024-03-06 14:38:48 +00:00
compress_offload.c
control.c
control_compat.c
control_led.c
ctljack.c
device.c
hrtimer.c
hwdep.c
hwdep_compat.c
info.c ALSA: info: Fix potential deadlock at disconnection 2023-11-28 16:56:32 +00:00
info_oss.c
init.c ALSA: Fix deadlocks with kctl removals at disconnection 2024-06-16 13:39:13 +02:00
isadma.c
jack.c ALSA: jack: Fix mutex call in snd_jack_report() 2023-07-23 13:47:19 +02:00
memalloc.c
memalloc_local.h
memory.c
misc.c
pcm.c ALSA: pcm: fix out-of-bounds in snd_pcm_state_names 2023-12-13 18:36:42 +01:00
pcm_compat.c ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl 2023-09-19 12:22:50 +02:00
pcm_dmaengine.c
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c
pcm_local.h
pcm_memory.c ALSA: pcm: Fix potential data race at PCM memory allocation helpers 2023-08-30 16:18:12 +02:00
pcm_misc.c
pcm_native.c ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks 2023-05-17 11:50:26 +02:00
pcm_param_trace.h
pcm_timer.c
pcm_trace.h
rawmidi.c
rawmidi_compat.c
seq_device.c
sgbuf.c
sound.c
sound_oss.c
timer.c ALSA: timer: Set lower bound of start tick time 2024-06-16 13:39:52 +02:00
timer_compat.c
vmaster.c