All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()" has been added to the 4.5-stable tree
@ 2016-04-09 23:45 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-04-09 23:45 UTC (permalink / raw)
  To: tiwai, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()

to the 4.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-usb-audio-fix-null-dereference-in-create_fixed_stream_quirk.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 0f886ca12765d20124bd06291c82951fd49a33be Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 15 Mar 2016 12:09:10 +0100
Subject: ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()

From: Takashi Iwai <tiwai@suse.de>

commit 0f886ca12765d20124bd06291c82951fd49a33be upstream.

create_fixed_stream_quirk() may cause a NULL-pointer dereference by
accessing the non-existing endpoint when a USB device with a malformed
USB descriptor is used.

This patch avoids it simply by adding a sanity check of bNumEndpoints
before the accesses.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=971125
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/quirks.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -180,6 +180,12 @@ static int create_fixed_stream_quirk(str
 	}
 	alts = &iface->altsetting[fp->altset_idx];
 	altsd = get_iface_desc(alts);
+	if (altsd->bNumEndpoints < 1) {
+		kfree(fp);
+		kfree(rate_table);
+		return -EINVAL;
+	}
+
 	fp->protocol = altsd->bInterfaceProtocol;
 
 	if (fp->datainterval == 0)


Patches currently in stable-queue which might be from tiwai@suse.de are

queue-4.5/alsa-usb-audio-add-microsoft-hd-5001-to-quirks.patch
queue-4.5/alsa-usb-audio-fix-null-dereference-in-create_fixed_stream_quirk.patch
queue-4.5/alsa-usb-audio-minor-code-cleanup-in-create_fixed_stream_quirk.patch
queue-4.5/alsa-usb-audio-fix-double-free-in-error-paths-after-snd_usb_add_audio_stream-call.patch
queue-4.5/alsa-usb-audio-add-sanity-checks-for-endpoint-accesses.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-09 23:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-09 23:45 Patch "ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()" has been added to the 4.5-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.