* [PATCH] usb: gadget: f_uac1: fix ac_header_desc in descriptor lists
@ 2026-10-01 7:58 paritoshpotukuchi
0 siblings, 0 replies; only message in thread
From: paritoshpotukuchi @ 2026-10-01 7:58 UTC (permalink / raw)
To: linux-usb
Cc: gregkh, linux-kernel, syzkaller-bugs,
syzbot+debc5c305403f180c01c, Paritosh Potukuchi
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-01 7:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 7:58 [PATCH] usb: gadget: f_uac1: fix ac_header_desc in descriptor lists paritoshpotukuchi
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®