linux-stable/sound/usb
Dan Carpenter 1102fb2aa4 ALSA: usb-audio: Fix a DMA to stack memory bug
commit f7d306b47a upstream.

The usb_get_descriptor() function does DMA so we're not allowed
to use a stack buffer for that.  Doing DMA to the stack is not portable
all architectures.  Move the "new_device_descriptor" from being stored
on the stack and allocate it with kmalloc() instead.

Fixes: b909df18ce ("ALSA: usb-audio: Fix potential out-of-bound accesses for Extigy and Mbox devices")
Cc: stable@kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/60e3aa09-039d-46d2-934c-6f123026c2eb@stanley.mountain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Benoît Sevens <bsevens@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-19 18:05:05 +01:00
..
6fire ALSA: 6fire: Release resources at card release 2024-12-14 19:44:27 +01:00
bcd2000 ALSA: bcd2000: Fix a UAF bug on the error path of probing 2022-08-25 11:17:17 +02:00
caiaq ALSA: caiaq: Use snd_card_free_when_closed() at disconnection 2024-12-14 19:44:27 +01:00
hiface ALSA: hiface: fix multiple memory leak bugs 2019-08-07 12:20:00 +02:00
line6 ALSA: line6: Fix racy access to midibuf 2024-08-19 05:33:51 +02:00
misc ALSA: ua101: fix division by zero at probe 2021-11-17 09:48:18 +01:00
usx2y ALSA: us122l: Use snd_card_free_when_closed() at disconnection 2024-12-14 19:44:27 +01:00
card.c ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls 2021-05-14 09:44:27 +02:00
card.h ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109 2020-08-19 08:16:24 +02:00
clock.c ALSA: usb-audio: Fix out of bounds reads when finding clock sources 2024-12-14 19:44:56 +01:00
clock.h ALSA: usb-audio: Add clock validity quirk for Denon MC7000/MCX8000 2020-02-19 19:52:57 +01:00
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
endpoint.c treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
endpoint.h Revert "ALSA: usb-audio: Improve frames size computation" 2020-07-09 09:37:55 +02:00
format.c ALSA: usb-audio: Fix regression on detection of Roland VS-100 2023-04-05 11:16:45 +02:00
format.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
helper.c USB: move snd_usb_pipe_sanity_check into the USB core 2024-08-19 05:33:30 +02:00
helper.h USB: move snd_usb_pipe_sanity_check into the USB core 2024-08-19 05:33:30 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile Merge branch 'topic/usb-validation' into for-next 2019-08-22 15:42:03 +02:00
media.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
media.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
midi.c ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() 2022-11-25 17:42:17 +01:00
midi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer_maps.c ALSA: usb-audio: Add dB range mapping for Sennheiser Communications Headset PC 8 2021-05-11 14:04:13 +02:00
mixer_quirks.c ALSA: usb-audio: Add endianness annotations 2024-11-17 14:58:52 +01:00
mixer_quirks.h ALSA: usb-audio: Initialize Dell Dock playback volumes 2018-05-02 16:02:32 +02:00
mixer_scarlett_gen2.c USB: move snd_usb_pipe_sanity_check into the USB core 2024-08-19 05:33:30 +02:00
mixer_scarlett_gen2.h ALSA: usb-audio: scarlett2: Improve driver startup messages 2021-06-03 08:59:00 +02:00
mixer_scarlett.c ALSA: usb-audio: More constifications 2021-05-11 14:04:13 +02:00
mixer_scarlett.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer_us16x08.c ALSA: usb-audio: US16x08: fix value count for level meters 2020-12-08 10:40:27 +01:00
mixer_us16x08.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer.c ALSA: usb-audio: Add missing proc text entry for BESPOKEN type 2021-07-28 13:30:58 +02:00
mixer.h ALSA: usb-audio: scarlett2: Fix wrong resume call 2021-07-14 16:52:59 +02:00
pcm.c ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode 2021-03-04 10:26:10 +01:00
pcm.h ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume 2018-07-31 15:01:36 +02:00
power.c ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
power.h ALSA: usb-audio: Initial Power Domain support 2018-07-31 15:01:22 +02:00
proc.c ALSA: usb-audio: More constifications 2021-05-11 14:04:13 +02:00
proc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
quirks-table.h ALSA: usb-audio: Support Yamaha P-125 quirk entry 2024-09-04 13:14:49 +02:00
quirks.c ALSA: usb-audio: Fix a DMA to stack memory bug 2024-12-19 18:05:05 +01:00
quirks.h ALSA: usb-audio: Rewrite registration quirk handling 2020-07-22 09:32:59 +02:00
stream.c ALSA: usb-audio: Correct surround channels in UAC1 channel map 2024-08-19 05:33:45 +02:00
stream.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usbaudio.h ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant 2022-04-27 13:50:47 +02:00
validate.c ALSA: usb-audio: More constifications 2021-05-11 14:04:13 +02:00