提交 b1f7bb50 编写于 作者: J Johan Hovold 提交者: Yang Yingliang

ALSA: usb-audio: fix sync-ep altsetting sanity check

commit 5d1b7122 upstream.

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: c75a8a7a ("ALSA: snd-usb: add support for implicit feedback")
Fixes: ca10a7eb ("ALSA: usb-audio: FT C400 sync playback EP to capture EP")
Fixes: 5e35dc03 ("ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204")
Fixes: 17f08b0d ("ALSA: usb-audio: add implicit fb quirk for Axe-Fx II")
Fixes: 103e9625 ("ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk")
Cc: stable <stable@vger.kernel.org>     # 3.5
Signed-off-by: NJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20200114083953.1106-1-johan@kernel.orgSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 dc05d8c3
......@@ -377,7 +377,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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册