Linux USB
 help / color / mirror / Atom feed
From: Paritosh Potukuchi <paritoshpotukuchi@gmail.com>
To: linux-usb@vger.kernel.org
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com,
	Paritosh Potukuchi <paritosh.potukuchi@amd.com>,
	syzbot+debc5c305403f180c01c@syzkaller.appspotmail.com
Subject: [PATCH] usb: gadget: f_uac1: fix ac_header_desc in SS descriptor list
Date: Sat,  1 Aug 2026 21:08:34 +0000	[thread overview]
Message-ID: <20260801210834.3809187-1-paritosh.potukuchi@amd.com> (raw)

ac_header_desc is a pointer to a dynamically allocated
uac1_ac_header_descriptor. The SS descriptor list
incorrectly stores &ac_header_desc, which is the address of
the pointer variable rather than the descriptor itself.

usb_copy_descriptors() interprets the entry as a USB
descriptor header, which can lead to a global-out-of-bounds
read.

Store ac_header_desc instead of &ac_header_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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 85c502e98f57..95d53ac8cedb 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -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.54.0


                 reply	other threads:[~2026-08-01 21:08 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=20260801210834.3809187-1-paritosh.potukuchi@amd.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