linux/sound/drivers
Cássio Gabriel 359b626d36 ALSA: pcmtest: Return -EFAULT on pattern read copy failure
pattern_write() reports -EFAULT when copy_from_user() fails, but
pattern_read() converts copy_to_user() failures into a zero-length read.
That makes a userspace buffer fault look like EOF instead of reporting the
actual error.

Return -EFAULT from pattern_read() when copying the pattern data to
userspace fails, and update the file offset only after a successful copy.

Fixes: 315a3d57c6 ("ALSA: Implement the new Virtual PCM Test Driver")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260501-alsa-pcmtest-pattern-read-efault-v1-1-53e1e8c11dda@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-05-04 13:26:23 +02:00
..
mpu401 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
opl3 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
opl4 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pcsp ALSA: pcsp: Use safer strscpy() instead of strcpy() 2025-07-11 09:51:09 +02:00
vx ALSA: vx: use correct function name in kernel-doc comment 2026-04-17 09:48:20 +02:00
aloop.c ALSA: aloop: Fix peer runtime UAF during format-change stop 2026-04-27 13:50:37 +02:00
dummy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08: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
mtpav.c ALSA: mtpav: Use guard() for spin locks 2025-09-01 13:53:35 +02:00
mts64.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pcmtest.c ALSA: pcmtest: Return -EFAULT on pattern read copy failure 2026-05-04 13:26:23 +02:00
portman2x4.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08: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