From: paritoshpotukuchi@gmail.com
To: linux-usb@vger.kernel.org
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com,
syzbot+debc5c305403f180c01c@syzkaller.appspotmail.com,
Paritosh Potukuchi <paritosh.potukuchi@amd.com>
Subject: [PATCH] usb: gadget: f_uac1: fix ac_header_desc in descriptor lists
Date: Thu, 1 Oct 2026 07:58:08 +0000 [thread overview]
Message-ID: <20261001075808.2156188-1-paritoshpotukuchi@gmail.com> (raw)
From: Paritosh Potukuchi <paritosh.potukuchi@amd.com>
ac_header_desc is a pointer to a dynamically allocated
uac1_ac_header_descriptor. The descriptor lists incorrectly
store &ac_header_desc, which is the address of the pointer
variable rather than the descriptor itself.
usb_copy_descriptors() interprets entries in these lists as
USB descriptor headers. As a result, passing
&ac_header_desc causes the pointer variable itself to be
interpreted as a descriptor and can lead to out-of-bounds
memory accesses.
Store ac_header_desc instead of &ac_header_desc in both
f_audio_desc and f_audio_ss_desc.
Fixes: 0591bc236015 ("usb: gadget: add f_uac1 variant based on a new u_audio api")
Reported-by: syzbot+debc5c305403f180c01c@syzkaller.appspotmail.com
Link: https://lore.kernel.org/all/6a68b182.4c659fcc.19cd90.0021.GAE@google.com/T/
Signed-off-by: Paritosh Potukuchi <paritosh.potukuchi@amd.com>
---
drivers/usb/gadget/function/f_uac1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 7a81cd176abd..94cc90389f6a 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -260,7 +260,7 @@ static struct uac_iso_endpoint_descriptor as_iso_in_desc = {
static struct usb_descriptor_header *f_audio_desc[] = {
(struct usb_descriptor_header *)&ac_interface_desc,
- (struct usb_descriptor_header *)&ac_header_desc,
+ (struct usb_descriptor_header *)ac_header_desc,
(struct usb_descriptor_header *)&usb_out_it_desc,
(struct usb_descriptor_header *)&io_out_ot_desc,
@@ -332,7 +332,7 @@ static struct usb_ss_ep_comp_descriptor ss_as_in_ep_desc_comp = {
static struct usb_descriptor_header *f_audio_ss_desc[] = {
(struct usb_descriptor_header *)&ac_interface_desc,
- (struct usb_descriptor_header *)&ac_header_desc,
+ (struct usb_descriptor_header *)ac_header_desc,
(struct usb_descriptor_header *)&usb_out_it_desc,
(struct usb_descriptor_header *)&io_out_ot_desc,
--
2.55.0
reply other threads:[~2026-10-01 7:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261001075808.2156188-1-paritoshpotukuchi@gmail.com \
--to=paritoshpotukuchi@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=paritosh.potukuchi@amd.com \
--cc=syzbot+debc5c305403f180c01c@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®