From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 916C22F9D85; Thu, 28 May 2026 20:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999456; cv=none; b=NeMZjx/BPANb/TbTD9p6ucjycAoPzqnhO2bUi5dzyzsBr9Ky0DR+HoOO9hb24kZ1Z+o+iN5PG6dYn5bci7JL/BMCjeyn2AcNyLYfHGKH7Q/IWVZuDKp070qF15kXUwWQ3bL9hRwL8nLJH2wqffsMM/wQwRzPzlEP+12gu4WA+gA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999456; c=relaxed/simple; bh=ElbZCV+MNZHnQ/i7aVRMIzDN23PfKh8NPF55MYZDRv8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VZem7J46OFYHGlKWvm8nJD0SHzJLCrcfujDzW3ZI1CC2iEWWh23Vqj+5PPTdZ0mkq+uUBl3Ei4EJBEPJ9Bz/nvEZhQtGLztsLHoY5A9HLV3IvdDTTvip/AGz12gDwn1V8JEdqy85Uc83QzQqnaMikAmf7Ap2wRSlSRcQnl4eYOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R3xY+l8j; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="R3xY+l8j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F12311F000E9; Thu, 28 May 2026 20:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779999455; bh=M99br3uxldbyeQ7K4e4FPPDVLx9+3r9MWqQ8O86Ka8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R3xY+l8jvfWP/6RPdC3Bxz8oOlEhMAB0z3mEL3BPGN/hjR1FxUcHZv6SEEF1mmmbs H8qTubfpvKkpqZnTglAyHk71gnRZ4ecUA+Dndx/6khuti2F1P5dMud8j3K7e1dKN+x sK5AhXvVxuwnz27injQki+I9VZ+eoqbuq50awfSo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?C=C3=A1ssio=20Gabriel?= , Takashi Iwai Subject: [PATCH 6.18 037/377] ALSA: ua101: Reject too-short USB descriptors Date: Thu, 28 May 2026 21:44:35 +0200 Message-ID: <20260528194639.451023873@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cássio Gabriel commit b59d5c51bb328a60749b4dd5fe7e649bfb4089b4 upstream. find_format_descriptor() walks the class-specific interface extras by advancing with bLength. It rejects descriptors that extend past the remaining buffer, but it does not reject descriptor lengths smaller than a USB descriptor header. Reject too-short descriptors before using bLength to advance the local scan. This keeps the UA-101 parser robust against malformed descriptor data and matches the usual USB descriptor walking rules. Fixes: 63978ab3e3e9 ("sound: add Edirol UA-101 support") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel Link: https://patch.msgid.link/20260519-alsa-ua101-desc-len-v1-1-4307d1a5e054@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/misc/ua101.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c @@ -894,8 +894,9 @@ find_format_descriptor(struct usb_interf struct uac_format_type_i_discrete_descriptor *desc; desc = (struct uac_format_type_i_discrete_descriptor *)extra; - if (desc->bLength > extralen) { - dev_err(&interface->dev, "descriptor overflow\n"); + if (desc->bLength < sizeof(struct usb_descriptor_header) || + desc->bLength > extralen) { + dev_err(&interface->dev, "invalid descriptor length\n"); return NULL; } if (desc->bLength == UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1) &&