ALSA: usb-audio: fix sync-ep altsetting sanity check
Subsystems (2)
PATCH 1/1 ALSA: usb-audio: fix sync-ep altsetting sanity check
The altsetting sanity check in set_sync_ep_implicit_fb_quirk() was checking for there to be at least one altsetting but then went on to access the second one, which may not exist.
This could lead to random slab data being used to initialise the sync endpoint in snd_usb_add_endpoint().
Fixes c75a8a7ae565 ("ALSA: snd-usb: add support for implicit feedback")
Fixes ca10a7ebdff1 ("ALSA: usb-audio: FT C400 sync playback EP to capture EP")
Fixes 5e35dc0338d8 ("ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204")
Fixes 17f08b0d9aaf ("ALSA: usb-audio: add implicit fb quirk for Axe-Fx II")
Fixes 103e9625647a ("ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk")
Cc stable <[email protected]> # 3.5
Signed-off-by Johan Hovold <[email protected]>
--- sound/usb/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/pcm.c +1 -1
@@ -370,7 +370,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, add_sync_ep_from_ifnum: iface =usb_ifnum_to_if (dev, ifnum); -if (!iface || iface->num_altsetting ==0 ) +if (!iface || iface->num_altsetting <2 )return -EINVAL ; alts = &iface->altsetting[1 ];
Signature · 1 line
2.24.1
Takashi Iwai
AppliedQuoted 8 lines · Johan Hovold
The altsetting sanity check in
set_sync_ep_implicit_fb_quirk()was checking for there to be at least one altsetting but then went on to access the second one, which may not exist.This could lead to random slab data being used to initialise the sync endpoint in
snd_usb_add_endpoint().
Quoted 7 lines
Fixes c75a8a7ae565 ("ALSA: snd-usb: add support for implicit feedback")Fixes ca10a7ebdff1 ("ALSA: usb-audio: FT C400 sync playback EP to capture EP")Fixes 5e35dc0338d8 ("ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204")Fixes 17f08b0d9aaf ("ALSA: usb-audio: add implicit fb quirk for Axe-Fx II")Fixes 103e9625647a ("ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk")Cc stable <[email protected]> # 3.5Signed-off-by Johan Hovold <[email protected]>
Thanks, applied now.
Takashi