linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Fix size validation in convert_chmap_v3()
@ 2025-08-18  9:59 Dan Carpenter
  2025-08-18 10:37 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-08-18  9:59 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, Karol Kosik, Youngjun Lee,
	linux-sound, linux-kernel, kernel-janitors

The "p" pointer is void so sizeof(*p) is 1.  The intent was to check
sizeof(*cs_desc), which is 3, instead.

Fixes: ecfd41166b72 ("ALSA: usb-audio: Validate UAC3 cluster segment descriptors")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 sound/usb/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index acf3dc2d79e0..5c235a5ba7e1 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -349,7 +349,7 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor
 		u16 cs_len;
 		u8 cs_type;
 
-		if (len < sizeof(*p))
+		if (len < sizeof(*cs_desc))
 			break;
 		cs_len = le16_to_cpu(cs_desc->wLength);
 		if (len < cs_len)
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix size validation in convert_chmap_v3()
  2025-08-18  9:59 [PATCH] ALSA: usb-audio: Fix size validation in convert_chmap_v3() Dan Carpenter
@ 2025-08-18 10:37 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-08-18 10:37 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Takashi Iwai, Jaroslav Kysela, Takashi Iwai, Karol Kosik,
	Youngjun Lee, linux-sound, linux-kernel, kernel-janitors

On Mon, 18 Aug 2025 11:59:45 +0200,
Dan Carpenter wrote:
> 
> The "p" pointer is void so sizeof(*p) is 1.  The intent was to check
> sizeof(*cs_desc), which is 3, instead.
> 
> Fixes: ecfd41166b72 ("ALSA: usb-audio: Validate UAC3 cluster segment descriptors")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-18 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  9:59 [PATCH] ALSA: usb-audio: Fix size validation in convert_chmap_v3() Dan Carpenter
2025-08-18 10:37 ` Takashi Iwai

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).