umber-kernel/sound/drivers
Takashi Iwai 5727ccf9d1 ALSA: aloop: Fix racy access at PCM trigger
commit 826af7fa62e347464b1b4e0ba2fe19a92438084f upstream.

The PCM trigger callback of aloop driver tries to check the PCM state
and stop the stream of the tied substream in the corresponding cable.
Since both check and stop operations are performed outside the cable
lock, this may result in UAF when a program attempts to trigger
frequently while opening/closing the tied stream, as spotted by
fuzzers.

For addressing the UAF, this patch changes two things:
- It covers the most of code in loopback_check_format() with
  cable->lock spinlock, and add the proper NULL checks.  This avoids
  already some racy accesses.
- In addition, now we try to check the state of the capture PCM stream
  that may be stopped in this function, which was the major pain point
  leading to UAF.

Reported-by: syzbot+5f8f3acdee1ec7a7ef7b@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/69783ba1.050a0220.c9109.0011.GAE@google.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20260203141003.116584-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-11 13:41:41 +01:00
..
mpu401 ALSA: mpu401: Use guard() for spin locks 2025-09-01 13:53:34 +02:00
opl3 ALSA: opl3: Use guard() for spin locks 2025-09-01 13:53:34 +02:00
opl4 ALSA: opl4: Use guard() for spin locks 2025-09-01 13:53:34 +02:00
pcsp ALSA: pcsp: Use safer strscpy() instead of strcpy() 2025-07-11 09:51:09 +02:00
vx ALSA: vx: Use guard() for mutex locks 2025-09-01 13:53:34 +02:00
Kconfig ALSA: Make SND_PCMTEST depend on DEBUG_FS 2023-08-18 09:10:22 +02:00
Makefile ALSA: drivers: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:57 +02:00
aloop.c ALSA: aloop: Fix racy access at PCM trigger 2026-02-11 13:41:41 +01:00
dummy.c ALSA: dummy: Use guard() for spin locks 2025-09-01 13:53:34 +02:00
mtpav.c ALSA: mtpav: Use guard() for spin locks 2025-09-01 13:53:35 +02:00
mts64.c ALSA: mts64: Use guard() for spin locks 2025-09-01 13:53:35 +02:00
pcmtest.c ALSA: pcmtest: Replace deprecated strcpy() with strscpy() 2025-07-02 16:27:49 +02:00
portman2x4.c ALSA: portman2x4: Use guard() for spin locks 2025-09-01 13:53:35 +02:00
serial-generic.c ALSA: serial-generic: remove shared static buffer 2025-09-15 12:33:53 +02:00
serial-u16550.c ALSA: serial-u16550: Use guard() for spin locks 2025-09-01 13:53:35 +02:00
virmidi.c ALSA: virmidi: Use safer strscpy() instead of strcpy() 2025-07-11 09:51:09 +02:00