[PATCH] usb: gadget: f_uac1: fix ac_header_desc in SS descriptor list

Paritosh Potukuchi <[email protected]> Sat, 1 Aug 2026 21:08:34 +0000
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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: [email protected]
Link: https://lore.kernel.org/all/[email protected]/T/
Signed-off-by: Paritosh Potukuchi <[email protected]>
---
 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