summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-08-18 12:59:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:21:37 +0200
commit6cd6e75cf9cf19efedd8835de52dbfb6e47a8cfe (patch)
tree7cc9b35af8d798f20115acd00727d50ee26750c5 /sound
parentd0225f41ee70611ca88ccb22c8542ecdfa7faea8 (diff)
downloadlinux-6cd6e75cf9cf19efedd8835de52dbfb6e47a8cfe.tar.gz
linux-6cd6e75cf9cf19efedd8835de52dbfb6e47a8cfe.tar.bz2
linux-6cd6e75cf9cf19efedd8835de52dbfb6e47a8cfe.zip
ALSA: usb-audio: Fix size validation in convert_chmap_v3()
[ Upstream commit 89f0addeee3cb2dc49837599330ed9c4612f05b0 ] 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> Link: https://patch.msgid.link/aKL5kftC1qGt6lpv@stanley.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index 47cfaf29fdd7..bb919f1d4043 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -350,7 +350,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)