linux-stable/sound
Takashi Iwai 74bfb8d90f 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-16 13:28:48 +02:00
..
ac97 ALSA: ac97: fix PM reference leak in ac97_bus_remove() 2021-07-20 16:10:42 +02:00
aoa ALSA: aoa: Fix I2S device accounting 2022-11-03 23:56:56 +09:00
arm treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
atmel
core ALSA: timer: Set lower bound of start tick time 2024-06-16 13:28:48 +02:00
drivers treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
firewire ALSA: firewire-digi00x: prevent potential use after free 2023-05-30 12:44:05 +01:00
hda ALSA: hda: Fix possible null-ptr-deref when assigning a stream 2023-11-28 16:50:15 +00:00
i2c ALSA: i2c/cs8427: fix iec958 mixer control deactivation 2023-04-20 12:07:35 +02:00
isa treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
mips treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
oss sound: dmasound_atari: Mark expected switch fall-through 2019-07-30 09:36:13 +02:00
parisc
pci ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone 2024-04-13 12:51:36 +02:00
pcmcia
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:10:44 +02:00
sh ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs 2024-04-13 12:51:32 +02:00
soc ASoC: da7219-aad: fix usage of device_get_named_child_node() 2024-06-16 13:28:31 +02:00
sparc
spi ALSA: spi: Add check for clk_enable() 2022-04-15 14:18:08 +02:00
synth ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-22 12:50:30 +01:00
usb ALSA: line6: Zero-initialize message buffers 2024-05-17 11:43:51 +02:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:07:46 +01:00
xen ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
ac97_bus.c
Kconfig um: Fix hostaudio build errors 2023-09-23 10:59:53 +02:00
last.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Makefile
sound_core.c