ALSA: usb-audio: Fix NULL dereference at parsing BADD
PATCH 1/1 ALSA: usb-audio: Fix NULL dereference at parsing BADD
snd_usb_mixer_controls_badd() that parses UAC3 BADD profiles misses a NULL check for the given interfaces. When a malformed USB descriptor is passed, this may lead to an Oops, as spotted by syzkaller. Skip the iteration if the interface doesn't exist for avoiding the crash.
Fixes 17156f23e93c ("ALSA: usb: add UAC3 BADD profiles support")
Reported-by [email protected]
Suggested-by Dan Carpenter <[email protected]>
Cc <[email protected]>
Signed-off-by Takashi Iwai <[email protected]>
--- sound/usb/mixer.c | 3 +++ 1 file changed, 3 insertions(+)
sound/usb/mixer.c +3 -0
@@ -2930,6 +2930,9 @@ static int snd_usb_mixer_controls_badd(struct usb_mixer_interface *mixer,continue ; iface =usb_ifnum_to_if (dev, intf); +if (!iface) +continue ; + num = iface->num_altsetting;if (num <2 )
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel