From: sashiko-bot@kernel.org
To: "Vineet Thakran" <vineet789thakran@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 6/6] usb: gadget: f_uac1: fix feature unit and AC header descriptor leak
Date: Sat, 05 Dec 2026 11:20:00 +0000 [thread overview]
Message-ID: <sashiko-outbox-251458@kernel.org> (raw)
In-Reply-To: <20261205110831.204588-7-vineet789thakran@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] usb: gadget: f_uac1: missing Fixes tag for commit b8fb6db6cb04
--
commit a85ccf2bbf11aaa9c0c1c9b9110fcce6fe4b8e2f
Author: Vineet Thakran <vineet789thakran@gmail.com>
> usb: gadget: f_uac1: fix feature unit and AC header descriptor leak
>
> f_audio_bind() allocates the AC header and feature unit descriptors and
> stores them in the file-scope ac_header_desc, in_feature_unit_desc and
> out_feature_unit_desc pointers, which are freed only in
> f_audio_unbind(). When a configuration contains more than one f_uac1
> instance, each bind overwrites the pointers left by the previous one,
> and those descriptors are leaked. This is the same problem syzbot
> reported for f_uac2.
>
> usb_assign_descriptors() copies the descriptors into the function, and
> since the previous patches nothing uses them after f_audio_bind(). Make
> them local variables of f_audio_bind(), pass them to setup_descriptor(),
> free them on every exit path of f_audio_bind(), including success, and
> drop the now redundant kfree() calls from f_audio_unbind().
>
> The static f_audio_desc and f_audio_ss_desc arrays used to take the
> address of the file-scope pointers. Their entries become NULL
> placeholders, and setup_descriptor() now fills in the AC header entry of
> f_audio_ss_desc the same way it already does for f_audio_desc.
>
> Fixes: 254cb1e0d78c ("usb: gadget: f_uac1: disable IN/OUT ep if unused")
> Fixes: 0356e6283c71 ("usb: gadget: f_uac1: add volume and mute support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Vineet Thakran <vineet789thakran@gmail.com>
[Severity: Low]
Since this also fixes f_audio_ss_desc[1] taking the address of the
ac_header_desc pointer instead of storing the allocated descriptor in
setup_descriptor(), should this include:
Fixes: b8fb6db6cb04 ("usb: f_uac1: adds support for SS and SSP")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205110831.204588-1-vineet789thakran@gmail.com?part=6
next prev parent reply other threads:[~2026-12-05 11:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 11:08 [PATCH v2 0/6] usb: gadget: f_uac1/f_uac2: fix descriptor leaks, NULL deref and bind race with multiple instances Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 1/6] usb: gadget: f_uac2: use per-instance feature unit IDs in control requests Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 2/6] usb: gadget: f_uac2: serialize bind with a mutex Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 3/6] usb: gadget: f_uac2: fix feature unit descriptor leak Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 4/6] usb: gadget: f_uac1: use per-instance feature unit IDs in control requests Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 5/6] usb: gadget: f_uac1: serialize bind with a mutex Vineet Thakran
2026-12-05 11:08 ` [PATCH v2 6/6] usb: gadget: f_uac1: fix feature unit and AC header descriptor leak Vineet Thakran
2026-12-05 11:20 ` sashiko-bot [this message]
2026-12-05 11:24 ` [PATCH v2 0/6] usb: gadget: f_uac1/f_uac2: fix descriptor leaks, NULL deref and bind race with multiple instances sashiko-bot
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=sashiko-outbox-251458@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vineet789thakran@gmail.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