[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_5FFE6CF02F716D549514EB16EC6ACC3C780A@qq.com>
Date: Tue, 16 Jul 2024 18:24:37 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+78d5b129a762182225aa@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [sound?] [usb?] UBSAN: shift-out-of-bounds in parse_audio_unit
invalid bControlSize and bLength make channels too large
#syz test: upstream a19ea421490d
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 409fc1164694..17081ada6802 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2000,6 +2000,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
if (state->mixer->protocol == UAC_VERSION_1) {
csize = hdr->bControlSize;
channels = (hdr->bLength - 7) / csize - 1;
+ if (channels > 32)
+ return -EINVAL;
bmaControls = hdr->bmaControls;
} else if (state->mixer->protocol == UAC_VERSION_2) {
struct uac2_feature_unit_descriptor *ftr = _ftr;
Powered by blists - more mailing lists