On Sun, 26 May 2024 15:53:31 +0200, <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > > > This is a note to let you know that I've just added the patch titled > > ALSA: timer: Set lower bound of start tick time > > to the 5.10-stable tree which can be found at: > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > The filename of the patch is: > alsa-timer-set-lower-bound-of-start-tick-time.patch > and it can be found in the queue-5.10 subdirectory. > > If you, or anyone else, feels it should not be added to the stable tree, > please let <stable@xxxxxxxxxxxxxxx> know about it. Please drop this one for the kernels older than 6.9.x. This change requires the cleanup with guard() in commit beb45974dd49. I forgot to add the dependency in Cc. I'm going to submit an alternative patch for older kernels later. thanks, Takashi > > > From 4a63bd179fa8d3fcc44a0d9d71d941ddd62f0c4e Mon Sep 17 00:00:00 2001 > From: Takashi Iwai <tiwai@xxxxxxx> > Date: Tue, 14 May 2024 20:27:36 +0200 > Subject: ALSA: timer: Set lower bound of start tick time > > From: Takashi Iwai <tiwai@xxxxxxx> > > 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@xxxxxxxxxxxxxxxxxxxxxxxxx > Closes: https://lore.kernel.org/r/000000000000fa00a1061740ab6d@xxxxxxxxxx > Cc: <stable@xxxxxxxxxxxxxxx> > Link: https://lore.kernel.org/r/20240514182745.4015-1-tiwai@xxxxxxx > Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> > --- > sound/core/timer.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > --- a/sound/core/timer.c > +++ b/sound/core/timer.c > @@ -553,6 +553,14 @@ static int snd_timer_start1(struct snd_t > goto unlock; > } > > + /* check the actual time for the start tick; > + * bail out as error if it's way too low (< 100us) > + */ > + if (start) { > + if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000) > + return -EINVAL; > + } > + > if (start) > timeri->ticks = timeri->cticks = ticks; > else if (!timeri->cticks) > > > Patches currently in stable-queue which might be from tiwai@xxxxxxx are > > queue-5.10/alsa-core-fix-null-module-pointer-assignment-at-card-init.patch > queue-5.10/alsa-timer-set-lower-bound-of-start-tick-time.patch