From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [sound?] [usb?] UBSAN: shift-out-of-bounds in parse_audio_unit
Date: Tue, 16 Jul 2024 18:24:37 +0800 [thread overview]
Message-ID: <tencent_5FFE6CF02F716D549514EB16EC6ACC3C780A@qq.com> (raw)
In-Reply-To: <0000000000000adac5061d3c7355@google.com>
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;
next prev parent reply other threads:[~2024-07-16 10:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-14 22:15 syzbot
2024-07-16 7:05 ` Edward Adam Davis
2024-07-16 9:49 ` syzbot
2024-07-16 10:20 ` Edward Adam Davis
2024-07-16 10:58 ` syzbot
2024-07-16 10:24 ` Edward Adam Davis [this message]
2024-07-16 11:25 ` syzbot
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=tencent_5FFE6CF02F716D549514EB16EC6ACC3C780A@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®