Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Brian Ellis" <brianellis@gotenna.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v4] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
Date: Tue, 13 Oct 2026 21:06:07 +0000	[thread overview]
Message-ID: <sashiko-outbox-170509@kernel.org> (raw)
In-Reply-To: <20261013-u_serial-gs-close-null-v4-1-9ea038501994@gotenna.com>

> From: Brian Ellis <brianellis@gotenna.com>
> 
> gs_close() opens with
> 
> 	struct gs_port *port = tty->driver_data;
> 	...
> 	spin_lock_irq(&port->port_lock);
> 
> and never checks port.  gs_open() assigns tty->driver_data only on the
> port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL,
> and tty_open() calls tty_release(), and hence ->close(), when ->open()
> fails.
> 
> syzbot hit exactly this on arm64.  Fault injection failed the kfifo_alloc()
> of the write buffer in gs_open():
> [ ... ]
> Reported-by: syzbot+782b2f1063e38ba8fa6e@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=782b2f1063e38ba8fa6e
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Brian Ellis <brianellis@gotenna.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013-u_serial-gs-close-null-v4-1-9ea038501994@gotenna.com?part=1


      reply	other threads:[~2026-10-13 21:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 20:57 [PATCH v4] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Brian Ellis via B4 Relay
2026-10-13 21:06 ` 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-170509@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=brianellis@gotenna.com \
    --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