Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "YuanZhe Liu" <25031212351@stu.xidian.edu.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] USB: serial: opticon: fix use-after-free in write completion
Date: Mon, 30 Nov 2026 12:46:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-241091@kernel.org> (raw)
In-Reply-To: <20261130122213.11578-1-25031212351@stu.xidian.edu.cn>

> The write URBs are anchored in a per-port anchor that is embedded in
> the driver's private data, but the anchor is never drained when the
> port is removed.
> 
> The close callback does kill the anchored URBs, but it runs before the
> line discipline is released: tty_release() calls ->close() before
> tty_ldisc_release(), and some line disciplines (e.g. ppp) call
> tty->ops->write() directly from their transmit path.  A write
> submitted after the close callback has drained the anchor will
> therefore remain in flight until the port is removed, where the
> deferred giveback of the URB accesses the already freed private data:
> 
>     BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups
>     Write of size 4 at addr ...
>     ...
> [ ... ]
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130122213.11578-1-25031212351@stu.xidian.edu.cn?part=1

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:22 [PATCH v2] USB: serial: opticon: fix use-after-free in write completion YuanZhe Liu
2026-11-30 12: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-241091@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=25031212351@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