From: sashiko-bot@kernel.org
To: "Haoli Zhang" <26031212468@stu.xidian.edu.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: f_midi2: disable endpoints before freeing descriptors
Date: Fri, 20 Nov 2026 04:38:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-224464@kernel.org> (raw)
In-Reply-To: <20261120042607.1347854-1-26031212468@stu.xidian.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] usb: gadget: f_midi2: missing Fixes trailer in commit message
--
commit d500c7a9c97bc7945c1213bb986d1745dbdddb98
Author: Haoli Zhang <26031212468@stu.xidian.edu.cn>
> usb: gadget: f_midi2: disable endpoints before freeing descriptors
>
> The dummy_hcd driver keeps a pointer to an endpoint descriptor while the
> endpoint is enabled, and its timer dereferences that pointer in
> find_endpoint(). However, f_midi2_unbind() frees the function descriptors,
> while f_midi2_disable() currently only resets operation_mode. When the
> function is removed, an endpoint can therefore remain enabled while its
> descriptor storage is released.
>
> Disable the MIDI 1.0 endpoints and all MIDI 2.0 endpoints from
> f_midi2_disable() before the unbind callback releases the descriptors.
> Keep f_midi2_stop_eps() unchanged so altsetting transitions retain their
> existing request cleanup behavior.
>
> Reported-by: syzbot+599d4e8994a656eafe15@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=599d4e8994a656eafe15
> Co-developed-by: Jinning Zhang <25031212117@stu.xidian.edu.cn>
> Signed-off-by: Jinning Zhang <25031212117@stu.xidian.edu.cn>
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Haoli Zhang <26031212468@stu.xidian.edu.cn>
[Severity: Low]
Since this fixes a descriptor use-after-free in f_midi2_disable(), should
the commit message include:
Fixes: 8b645922b223 ("usb: gadget: Add support for USB MIDI 2.0 function driver")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120042607.1347854-1-26031212468@stu.xidian.edu.cn?part=1
prev parent reply other threads:[~2026-11-20 4:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 4:26 [PATCH] usb: gadget: f_midi2: disable endpoints before freeing descriptors Haoli Zhang
2026-11-20 4:38 ` sashiko-bot [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=sashiko-outbox-224464@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=26031212468@stu.xidian.edu.cn \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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