Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Johan Hovold" <johan@kernel.org>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] tty: fix saved termios reset race
Date: Wed, 30 Sep 2026 13:26:25 +0000	[thread overview]
Message-ID: <20260930132625.90BBB1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260930131845.1809256-1-johan@kernel.org>

> Resetting saved termios state on device registration is needed where a
> minor number can be reused for an entirely different device and where
> the old settings may prevent the port from even being opened (e.g. when
> CLOCAL is not set).
> 
> Not all TTY drivers guarantee that the minor number is no longer in use
> when registering devices however, something which can lead to a
> use-after-free when closing a TTY (and saving its termios) races with
> re-registration.
> 
> Add a new TTY_DRIVER_RESET_SAVED_TERMIOS flag to request that any saved
> termios state is reset on registration and only set it for drivers that
> make sure that the minor number is no longer in use.
> 
> Fixes: 93857edd9829 ("tty: reset termios state on device registration")
> Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com>
> Link: https://lore.kernel.org/20260926184154.3017929-1-nicoyip.dev@gmail.com
> Cc: stable@vger.kernel.org	# 4.12
> Signed-off-by: Johan Hovold <johan@kernel.org>

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

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260930131845.1809256-1-johan@kernel.org?part=1


      reply	other threads:[~2026-09-30 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 13:18 [PATCH v2] tty: fix saved termios reset race Johan Hovold
2026-09-30 13: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=20260930132625.90BBB1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-serial@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