linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Florian Hanisch <fhanisch@uni-potsdam.de>,
	Matthew Robbetts <wingfeathera@gmail.com>,
	Michael Beer <beerml@sigma6audio.de>,
	Daniel Mack <daniel@caiaq.de>,
	Clemens Ladisch <clemens@ladisch.de>,
	Takashi Iwai <tiwai@suse.de>
Subject: [ 44/89] ALSA: usb-audio: fix invalid length check for RME and other UAC 2 devices
Date: Fri,  1 Feb 2013 14:07:59 +0100	[thread overview]
Message-ID: <20130201130210.670386948@linuxfoundation.org> (raw)
In-Reply-To: <20130201130207.444989281@linuxfoundation.org>

3.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Clemens Ladisch <clemens@ladisch.de>

commit d56268fb108c7c21e19933588ca4d94652585183 upstream.

Commit 23caaf19b11e (ALSA: usb-mixer: Add support for Audio Class v2.0)
forgot to adjust the length check for UAC 2.0 feature unit descriptors.
This would make the code abort on encountering a feature unit without
per-channel controls, and thus prevented the driver to work with any
device having such a unit, such as the RME Babyface or Fireface UCX.

Reported-by: Florian Hanisch <fhanisch@uni-potsdam.de>
Tested-by: Matthew Robbetts <wingfeathera@gmail.com>
Tested-by: Michael Beer <beerml@sigma6audio.de>
Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1259,16 +1259,23 @@ static int parse_audio_feature_unit(stru
 		}
 		channels = (hdr->bLength - 7) / csize - 1;
 		bmaControls = hdr->bmaControls;
+		if (hdr->bLength < 7 + csize) {
+			snd_printk(KERN_ERR "usbaudio: unit %u: "
+				   "invalid UAC_FEATURE_UNIT descriptor\n",
+				   unitid);
+			return -EINVAL;
+		}
 	} else {
 		struct uac2_feature_unit_descriptor *ftr = _ftr;
 		csize = 4;
 		channels = (hdr->bLength - 6) / 4 - 1;
 		bmaControls = ftr->bmaControls;
-	}
-
-	if (hdr->bLength < 7 || !csize || hdr->bLength < 7 + csize) {
-		snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid);
-		return -EINVAL;
+		if (hdr->bLength < 6 + csize) {
+			snd_printk(KERN_ERR "usbaudio: unit %u: "
+				   "invalid UAC_FEATURE_UNIT descriptor\n",
+				   unitid);
+			return -EINVAL;
+		}
 	}
 
 	/* parse the source unit */



  parent reply	other threads:[~2013-02-01 13:11 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 13:07 [ 00/89] 3.7.6-stable review Greg Kroah-Hartman
2013-02-01 13:07 ` [ 01/89] can: c_can: fix invalid error codes Greg Kroah-Hartman
2013-02-01 13:07 ` [ 02/89] can: ti_hecc: " Greg Kroah-Hartman
2013-02-01 13:07 ` [ 03/89] can: pch_can: " Greg Kroah-Hartman
2013-02-01 13:07 ` [ 04/89] fs/cifs/cifs_dfs_ref.c: fix potential memory leakage Greg Kroah-Hartman
2013-02-01 13:07 ` [ 05/89] KVM: PPC: Emulate dcbf Greg Kroah-Hartman
2013-02-01 13:07 ` [ 06/89] powerpc/book3e: Disable interrupt after preempt_schedule_irq Greg Kroah-Hartman
2013-02-03 13:01   ` Ben Hutchings
2013-02-01 13:07 ` [ 07/89] ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem Greg Kroah-Hartman
2013-02-01 13:07 ` [ 08/89] ARM: OMAP2+: omap4-panda: add UART2 muxing for WiLink shared transport Greg Kroah-Hartman
2013-02-01 13:07 ` [ 09/89] ARM: at91: rm9200: remake the BGA as default version Greg Kroah-Hartman
2013-02-01 13:07 ` [ 10/89] ARM: S3C64XX: Fix up IRQ mapping for balblair on Cragganmore Greg Kroah-Hartman
2013-02-01 13:07 ` [ 11/89] ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone Greg Kroah-Hartman
2013-02-01 13:07 ` [ 12/89] ARM: 7628/1: head.S: map one extra section for the ATAG/DTB area Greg Kroah-Hartman
2013-02-01 13:07 ` [ 13/89] ARM: virt: Avoid bx instruction for compatibility with <=ARMv4 Greg Kroah-Hartman
2013-02-01 13:07 ` [ 14/89] ARM: virt: boot secondary CPUs through the right entry point Greg Kroah-Hartman
2013-02-01 13:07 ` [ 15/89] ARM: virt: simplify __hyp_stub_install epilog Greg Kroah-Hartman
2013-02-01 13:07 ` [ 16/89] mfd: tc3589x: Use simple irqdomain Greg Kroah-Hartman
2013-02-01 13:07 ` [ 17/89] Bluetooth: Fix sending HCI commands after reset Greg Kroah-Hartman
2013-02-01 13:07 ` [ 18/89] drm/radeon: fix cursor corruption on DCE6 and newer Greg Kroah-Hartman
2013-02-01 13:07 ` [ 19/89] radeon_display: Use pointer return error codes Greg Kroah-Hartman
2013-02-01 13:07 ` [ 20/89] IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround Greg Kroah-Hartman
2013-02-01 13:07 ` [ 21/89] xfs: Fix possible use-after-free with AIO Greg Kroah-Hartman
2013-02-01 13:07 ` [ 22/89] s390/thp: implement pmdp_set_wrprotect() Greg Kroah-Hartman
2013-02-01 13:07 ` [ 23/89] drm/i915: Disable AsyncFlip performance optimisations Greg Kroah-Hartman
2013-02-01 13:07 ` [ 24/89] drm/i915: GFX_MODE Flush TLB Invalidate Mode must be 1 for scanline waits Greg Kroah-Hartman
2013-02-01 13:07 ` [ 25/89] drm/i915: dump UTS_RELEASE into the error_state Greg Kroah-Hartman
2013-02-01 13:07 ` [ 26/89] mwifiex: update config_bands during infra association Greg Kroah-Hartman
2013-02-03 13:09   ` Ben Hutchings
2013-02-04 19:37     ` Bing Zhao
2013-02-01 13:07 ` [ 27/89] mwifiex: fix typo in PCIe adapter NULL check Greg Kroah-Hartman
2013-02-01 13:07 ` [ 28/89] iwlegacy: fix IBSS cleanup Greg Kroah-Hartman
2013-02-01 13:07 ` [ 29/89] brcmsmac: increase timer reference count for new timers only Greg Kroah-Hartman
2013-02-01 13:07 ` [ 30/89] brcmsmac: handle packet drop during transmit correctly Greg Kroah-Hartman
2013-02-01 13:07 ` [ 31/89] DM-RAID: Fix RAID10s check for sufficient redundancy Greg Kroah-Hartman
2013-02-01 13:07 ` [ 32/89] mac80211: synchronize scan off/on-channel and PS states Greg Kroah-Hartman
2013-02-01 13:07 ` [ 33/89] mac80211: fix FT roaming Greg Kroah-Hartman
2013-02-01 13:07 ` [ 34/89] ath9k_htc: Fix memory leak Greg Kroah-Hartman
2013-02-01 13:07 ` [ 35/89] ath9k: do not link receive buffers during flush Greg Kroah-Hartman
2013-02-01 13:07 ` [ 36/89] ath9k: fix double-free bug on beacon generate failure Greg Kroah-Hartman
2013-02-01 13:07 ` [ 37/89] ath9k: remove the WARN_ON that triggers if generating a beacon fails Greg Kroah-Hartman
2013-02-01 13:07 ` [ 38/89] ath9k: add a better fix for the rx tasklet vs rx flush race Greg Kroah-Hartman
2013-02-03 13:15   ` Ben Hutchings
2013-02-01 13:07 ` [ 39/89] ath9k: fix rx flush handling Greg Kroah-Hartman
2013-02-01 13:07 ` [ 40/89] ath9k: remove sc->rx.rxbuflock to fix a deadlock Greg Kroah-Hartman
2013-02-01 13:07 ` [ 41/89] ath9k: disable the tasklet before taking the PCU lock Greg Kroah-Hartman
2013-02-01 13:07 ` [ 42/89] ath9k_hw: fix chain swap setting when setting rx chainmask to 5 Greg Kroah-Hartman
2013-02-01 13:07 ` [ 43/89] ath9k: allow setting arbitrary antenna masks on AR9003+ Greg Kroah-Hartman
2013-02-01 13:07 ` Greg Kroah-Hartman [this message]
2013-02-01 13:08 ` [ 45/89] ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880 Greg Kroah-Hartman
2013-02-01 13:08 ` [ 46/89] ALSA: hda - fix inverted internal mic on Acer AOA150/ZG5 Greg Kroah-Hartman
2013-02-01 13:08 ` [ 47/89] ALSA: hda - Fix non-snoop page handling Greg Kroah-Hartman
2013-02-01 13:08 ` [ 48/89] EDAC: Test correct variable in ->store function Greg Kroah-Hartman
2013-02-01 13:08 ` [ 49/89] ASoC: arizona: Use actual rather than desired BCLK when calculating LRCLK Greg Kroah-Hartman
2013-02-01 13:08 ` [ 50/89] ASoC: wm2200: correct mixer values and text Greg Kroah-Hartman
2013-02-01 13:08 ` [ 51/89] Bluetooth: Fix incorrect strncpy() in hidp_setup_hid() Greg Kroah-Hartman
2013-02-01 13:08 ` [ 52/89] iommu/intel: disable DMAR for g4x integrated gfx Greg Kroah-Hartman
2013-02-01 13:08 ` [ 53/89] NFS: Fix error reporting in nfs_xdev_mount Greg Kroah-Hartman
2013-02-01 13:08 ` [ 54/89] NFS: Dont silently fail setattr() requests on mountpoints Greg Kroah-Hartman
2013-02-01 13:08 ` [ 55/89] NFSv4: Fix NFSv4 reference counting for trunked sessions Greg Kroah-Hartman
2013-02-01 13:08 ` [ 56/89] NFSv4: Fix NFSv4 trunking discovery Greg Kroah-Hartman
2013-02-01 13:08 ` [ 57/89] NFSv4.1: Ensure that nfs41_walk_client_list() does start lease recovery Greg Kroah-Hartman
2013-02-01 13:08 ` [ 58/89] NFSv4.1: Handle NFS4ERR_DELAY when resetting the NFSv4.1 session Greg Kroah-Hartman
2013-02-01 13:08 ` [ 59/89] HID: usbhid: quirk for Formosa IR receiver Greg Kroah-Hartman
2013-02-01 13:08 ` [ 60/89] smp: Fix SMP function call empty cpu mask race Greg Kroah-Hartman
2013-02-01 13:08 ` [ 61/89] x86/msr: Add capabilities check Greg Kroah-Hartman
2013-02-01 13:08 ` [ 62/89] efi: Make efi_enabled a function to query EFI facilities Greg Kroah-Hartman
2013-02-01 13:08 ` [ 63/89] samsung-laptop: Disable on EFI hardware Greg Kroah-Hartman
2013-02-01 13:08 ` [ 64/89] x86, efi: Fix display detection in EFI boot stub Greg Kroah-Hartman
2013-02-01 13:08 ` [ 65/89] x86, efi: Fix 32-bit EFI handover protocol entry point Greg Kroah-Hartman
2013-02-01 13:08 ` [ 66/89] efi, x86: Pass a proper identity mapping in efi_call_phys_prelog Greg Kroah-Hartman
2013-02-01 13:08 ` [ 67/89] x86, efi: Set runtime_version to the EFI spec revision Greg Kroah-Hartman
2013-02-01 13:08 ` [ 68/89] xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end Greg Kroah-Hartman
2013-02-13 15:30   ` Paolo Bonzini
2013-02-13 16:18     ` Greg Kroah-Hartman
2013-02-14  0:07       ` Dave Chinner
2013-02-14 19:26         ` Greg Kroah-Hartman
2013-02-14 19:55           ` Ben Myers
2013-02-14 20:05             ` Greg Kroah-Hartman
2013-02-14 20:35               ` Ben Myers
2013-02-15  1:47               ` Dave Chinner
2013-02-15 15:07                 ` Ben Myers
2013-02-01 13:08 ` [ 69/89] drm/radeon: fix error path in kpage allocation Greg Kroah-Hartman
2013-02-01 13:08 ` [ 70/89] drm/radeon: fix a rare case of double kfree Greg Kroah-Hartman
2013-02-01 13:08 ` [ 71/89] kvm: Fix irqfd resampler list walk Greg Kroah-Hartman
2013-02-01 13:08 ` [ 72/89] netfilter: ip[6]t_REJECT: fix wrong transport header pointer in TCP reset Greg Kroah-Hartman
2013-02-01 13:08 ` [ 73/89] netfilter: nf_ct_reasm: fix conntrack reassembly expire code Greg Kroah-Hartman
2013-02-01 13:08 ` [ 74/89] x86/Sandy Bridge: Sandy Bridge workaround depends on CONFIG_PCI Greg Kroah-Hartman
2013-02-01 13:08 ` [ 75/89] xfs: fix periodic log flushing Greg Kroah-Hartman
2013-02-01 13:08 ` [ 76/89] target: fix regression with dev_link_magic in target_fabric_port_link Greg Kroah-Hartman
2013-02-01 13:08 ` [ 77/89] netfilter: nfnetlink_log: fix mac address for 6in4 tunnels Greg Kroah-Hartman
2013-02-01 13:08 ` [ 78/89] netfilter: nfnetlink_log: fix possible compilation issue due to missing include Greg Kroah-Hartman
2013-02-01 13:08 ` [ 79/89] netfilter: xt_CT: recover NOTRACK target support Greg Kroah-Hartman
2013-02-01 13:08 ` [ 80/89] netfilter: fix missing dependencies for the NOTRACK target Greg Kroah-Hartman
2013-02-01 13:08 ` [ 81/89] netfilter: xt_hashlimit: fix namespace destroy path Greg Kroah-Hartman
2013-02-01 13:08 ` [ 82/89] netfilter: xt_hashlimit: fix race that results in duplicated entries Greg Kroah-Hartman
     [not found]   ` <CA+6hz4qjj3wGgo-m50=qRxAN+OGUXKfUfgRp7Pys7NixgwQ3vQ@mail.gmail.com>
2013-02-01 15:32     ` Greg Kroah-Hartman
     [not found]       ` <CA+6hz4qjJpaH4HeoQ_NWT5ZX0+1PG-O87kxPK0rKEBG9go37DQ@mail.gmail.com>
2013-02-01 16:36         ` Greg Kroah-Hartman
2013-02-01 16:34     ` Pablo Neira Ayuso
2013-02-01 16:56       ` Feng Gao
2013-02-01 17:47         ` Pablo Neira Ayuso
2013-02-01 13:08 ` [ 83/89] netfilter: xt_recent: fix namespace destroy path Greg Kroah-Hartman
2013-02-01 13:08 ` [ 84/89] netfilter: xt_recent: avoid high order page allocations Greg Kroah-Hartman
2013-02-01 13:08 ` [ 85/89] netfilter: nf_conntrack: fix BUG_ON while removing nf_conntrack with netns Greg Kroah-Hartman
2013-02-01 13:08 ` [ 86/89] netfilter: x_tables: print correct hook names for ARP Greg Kroah-Hartman
2013-02-01 13:08 ` [ 87/89] netfilter: ctnetlink: fix leak in error path of ctnetlink_create_expect Greg Kroah-Hartman
2013-02-01 13:08 ` [ 88/89] drm/i915: fix FORCEWAKE posting reads Greg Kroah-Hartman
2013-02-01 13:08 ` [ 89/89] slub: assign refcount for kmalloc_caches Greg Kroah-Hartman
2013-02-01 23:24 ` [ 00/89] 3.7.6-stable review Shuah Khan
2013-02-02 21:39 ` Satoru Takeuchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130201130210.670386948@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=beerml@sigma6audio.de \
    --cc=clemens@ladisch.de \
    --cc=daniel@caiaq.de \
    --cc=fhanisch@uni-potsdam.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=wingfeathera@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).