All of lore.kernel.org
 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] usbip: vudc: check ep0->req_queue before list_last_entry() in get_gadget_descs()
Date: Fri, 04 Dec 2026 03:26:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-249045@kernel.org> (raw)
In-Reply-To: <20261204031417.1758713-1-zihengw03@163.com>

> get_gadget_descs() drops udc->lock to invoke udc->driver->setup(),
> reacquires the lock, and unconditionally calls list_last_entry() on
> &ep0->req_queue. If setup() did not queue a request or the queue was
> emptied while the lock was released, list_last_entry() computes an
> invalid struct vrequest pointer from the list head, leading to memory
> corruption in list_del() and usb_gadget_giveback_request().
> 
> Check list_empty(&ep0->req_queue) after reacquiring udc->lock and return
> -EPROTO if no request is queued.
> 
> Found by LLM-assisted static analysis. Compile-tested on x86_64.
> 
> Fixes: ea6873a45a22 ("usbip: vudc: Add SysFS infrastructure for VUDC")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ziheng Wei <zihengw03@163.com>

Sashiko has reviewed this patch and found no issues.

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

      reply	other threads:[~2026-12-04  3:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  3:14 [PATCH] usbip: vudc: check ep0->req_queue before list_last_entry() in get_gadget_descs() Ziheng Wei
2026-12-04  3:26 ` 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-249045@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.