linux-stable/sound/core
Takashi Iwai ceab795a67 ALSA: timer: Set lower bound of start tick time
commit 4a63bd179f 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 beb45974dd
  -- tiwai ]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-12 11:03:59 +02:00
..
oss ALSA: oss: avoid missing-prototype warnings 2023-06-09 10:34:16 +02:00
seq ALSA: seq: fix function cast warnings 2024-03-26 18:20:48 -04:00
Kconfig
Makefile ALSA: Drop leftover snd-rtctimer stuff from Makefile 2024-03-06 14:45:09 +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 17:07:15 +00:00
info_oss.c
init.c ALSA: core: Remove debugfs at disconnection 2024-06-12 11:03:55 +02:00
isadma.c
jack.c ALSA: core: Remove debugfs at disconnection 2024-06-12 11:03:55 +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:39:18 +01:00
pcm_compat.c ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl 2023-09-13 09:42:59 +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-07-19 16:21:47 +02:00
pcm_misc.c
pcm_native.c
pcm_param_trace.h
pcm_timer.c
pcm_trace.h
rawmidi.c
rawmidi_compat.c
seq_device.c
sound.c
sound_oss.c
timer.c ALSA: timer: Set lower bound of start tick time 2024-06-12 11:03:59 +02:00
timer_compat.c
vmaster.c