Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ziheng Wei" <zihengw03@163.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/2] usb: gadget: m66592-udc: recheck ep->queue after reacquiring lock
Date: Mon, 30 Nov 2026 10:46:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-240883@kernel.org> (raw)
In-Reply-To: <20261130103438.1384118-1-zihengw03@163.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] usb: gadget: m66592-udc: missing Fixes trailer for
  transfer_complete() fix
--

commit 40f941bfe13761b7a5dce12306fa96681696cfdf
Author: Ziheng Wei <zihengw03@163.com>

> usb: gadget: m66592-udc: recheck ep->queue after reacquiring lock
>
> In transfer_complete(), restart is computed from !list_empty(&ep->queue)
> before dropping ep->m66592->lock for usb_gadget_giveback_request(). While
> unlocked, the completion callback or a concurrent m66592_dequeue() can
> empty ep->queue while ep->ep.desc remains set, causing list_entry() to
> pass a bogus pointer to start_packet() once the lock is reacquired.
>
> Recheck !list_empty(&ep->queue) after reacquiring ep->m66592->lock.
>
> Found by LLM-assisted static analysis and runtime-tested in QEMU+KASAN
> (null-ptr-deref Oops in start_packet() before the fix; 0 findings after).
>
> Signed-off-by: Ziheng Wei <zihengw03@163.com>

[Severity: Low]
This fixes a bug in transfer_complete().  Should it include a Fixes: tag:

  Fixes: 4cf2503c6801 ("USB: m66592-udc: peripheral controller driver for M66592")

or for the commit that added the unlock/relock around the completion
callback:

  Fixes: 598f22e11bef ("USB: m66592-udc: fixes some problems")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130103438.1384118-1-zihengw03@163.com?part=1

      parent reply	other threads:[~2026-11-30 10:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:34 [PATCH 1/2] usb: gadget: m66592-udc: recheck ep->queue after reacquiring lock Ziheng Wei
2026-11-30 10:34 ` [PATCH 2/2] usb: gadget: r8a66597-udc: " Ziheng Wei
2026-11-30 10:40   ` sashiko-bot
2026-11-30 10:46 ` 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-240883@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zihengw03@163.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