2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/sound/core/seq
Takashi Iwai c9ce148ea7 ALSA: seq: Avoid module auto-load handling at event delivery
snd_seq_client_use_ptr() is supposed to return the snd_seq_client
object for the given client ID, and it tries to handle the module
auto-loading when no matching object is found.  Although the module
handling is performed only conditionally with "!in_interrupt()", this
condition may be fragile, e.g. when the code is called from the ALSA
timer callback where the spinlock is temporarily disabled while the
irq is disabled.  Then his doesn't fit well and spews the error about
sleep from invalid context, as complained recently by syzbot.

Also, in general, handling the module-loading at each time if no
matching object is found is really an overkill.  It can be still
useful when performed at the top-level ioctl or proc reads, but it
shouldn't be done at event delivery at all.

For addressing the issues above, this patch disables the module
handling in snd_seq_client_use_ptr() in normal cases like event
deliveries, but allow only in limited and safe situations.
A new function client_load_and_use_ptr() is used for the cases where
the module loading can be done safely, instead.

Reported-by: syzbot+4cb9fad083898f54c517@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/67c272e5.050a0220.dc10f.0159.GAE@google.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250301114530.8975-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-03-02 08:27:52 +01:00
..
oss ALSA: seq: oss: Simplify with str_enabled_disabled() 2025-01-07 17:35:25 +01:00
Kconfig ALSA: seq: Make dependency on UMP clearer 2025-01-01 13:56:48 +01:00
Makefile ALSA: core: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:32 +02:00
seq_clientmgr.c ALSA: seq: Avoid module auto-load handling at event delivery 2025-03-02 08:27:52 +01:00
seq_clientmgr.h ALSA: seq: Add UMP group filter 2023-05-23 12:11:38 +02:00
seq_compat.c ALSA: seq: core: Use automatic cleanup of kfree() 2024-02-23 10:57:31 +01:00
seq_dummy.c ALSA: seq: dummy: Allow UMP conversion 2024-04-19 12:11:47 +02:00
seq_fifo.c ALSA: seq: fifo: Use guard() for locking 2024-02-28 15:01:21 +01:00
seq_fifo.h ALSA: seq: Fix potential concurrent access to the deleted pool 2019-08-25 09:31:10 +02:00
seq_info.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
seq_info.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
seq_lock.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
seq_lock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
seq_memory.c ALSA: seq: memory: Use guard() for locking 2024-02-28 15:01:21 +01:00
seq_memory.h ALSA: seq: Add UMP support 2023-05-23 12:11:21 +02:00
seq_midi_emul.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
seq_midi_event.c ALSA: seq: midi: Use guard() for locking 2024-02-28 15:01:22 +01:00
seq_midi.c ALSA: seq: midi: Use guard() for locking 2024-02-28 15:01:22 +01:00
seq_ports.c ALSA: seq: Fix missing seq port info bit return for MIDI 1.0 block 2024-08-07 11:31:38 +02:00
seq_ports.h Merge branch 'topic/control-lookup-rwlock' into for-next 2024-08-09 14:25:24 +02:00
seq_prioq.c ALSA: seq: prioq: Use guard() for locking 2024-02-28 15:01:22 +01:00
seq_prioq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
seq_queue.c ALSA: seq: Add tempo base unit for MIDI2 Set Tempo messages 2024-07-06 09:38:27 +02:00
seq_queue.h ALSA: seq: Remove unused declarations 2024-08-17 16:32:31 +02:00
seq_system.c ALSA: seq: Allow system notification in atomic 2025-01-12 13:12:21 +01:00
seq_system.h ALSA: seq: Notify UMP EP and FB changes 2025-01-12 13:12:21 +01:00
seq_timer.c ALSA: seq: Add tempo base unit for MIDI2 Set Tempo messages 2024-07-06 09:38:27 +02:00
seq_timer.h ALSA: seq: Remove unused declarations 2024-08-17 16:32:31 +02:00
seq_ump_client.c ALSA: seq: Notify UMP EP and FB changes 2025-01-12 13:12:21 +01:00
seq_ump_convert.c Merge branch 'topic/control-lookup-rwlock' into for-next 2024-08-09 14:25:24 +02:00
seq_ump_convert.h ALSA: seq: Automatic conversion of UMP events 2023-05-23 12:11:28 +02:00
seq_virmidi.c ALSA: seq: virmidi: Use guard() for locking 2024-02-28 15:01:22 +01:00
seq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00