From: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
To: Paritosh Potukuchi <paritoshpotukuchi@gmail.com>
Cc: Aldo Ariel Panzardo <qwe.aldo@gmail.com>,
linux-usb@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
syzbot+debc5c305403f180c01c@syzkaller.appspotmail.com,
Paritosh Potukuchi <paritosh.potukuchi@amd.com>
Subject: Re: [PATCH] usb: gadget: f_uac1: fix ac_header_desc in descriptor lists
Date: Fri, 9 Oct 2026 23:28:56 -0300 [thread overview]
Message-ID: <20261010022858.3270406-1-qwe.aldo@gmail.com> (raw)
In-Reply-To: <20261001075808.2156188-1-paritoshpotukuchi@gmail.com>
On Thu, Oct 01, 2026 at 07:58:08AM +0000, Paritosh Potukuchi wrote:
> Store ac_header_desc instead of &ac_header_desc in both
> f_audio_desc and f_audio_ss_desc.
This doesn't build. f_audio_desc[] and f_audio_ss_desc[] are file-scope
arrays, so their initializers must be constant expressions.
&ac_header_desc is an address constant and is fine; ac_header_desc reads
the value of a mutable pointer, which is not a constant expression, so
both changed entries fail with "initializer element is not constant".
It also touches the array that isn't the problem. f_audio_desc[] (FS/HS)
is rebuilt entry by entry in afunc_bind() after the descriptor is
allocated, so its static initializer never reaches the core. The entry
that does reach the core unchanged is in f_audio_ss_desc[] (SS/SSP),
which is never rebuilt -- that is where &ac_header_desc is handed to
usb_copy_descriptors() and the pointer variable itself gets read as a
descriptor header.
So the fix belongs at run time rather than in the static initializer:
the f_audio_ss_desc[] AC-header slot needs to be set from ac_header_desc
after build_ac_header_desc() succeeds and before
usb_assign_descriptors(), the same way f_audio_desc[] is already built.
(Putting ac_header_desc in the static initializer would capture NULL
anyway, since it is only allocated in afunc_bind().)
Thanks,
Aldo
prev parent reply other threads:[~2026-10-10 2:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 7:58 paritoshpotukuchi
2026-10-10 2:28 ` Aldo Ariel Panzardo [this message]
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=20261010022858.3270406-1-qwe.aldo@gmail.com \
--to=qwe.aldo@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=paritosh.potukuchi@amd.com \
--cc=paritoshpotukuchi@gmail.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®