From: sashiko-bot@kernel.org
To: "Praneeth Balasubramanian" <praneethb2002@gmail.com>
Cc: linux-serial@vger.kernel.org, imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH 4/4] mxser: take termios_rwsem in mxser_set_serial_info()
Date: Sat, 05 Dec 2026 06:56:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-251164@kernel.org> (raw)
In-Reply-To: <20261205063536.2519566-5-praneethb2002@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] tty: mxser: missing Fixes trailer on bug-fix commit
--
commit 44a7f707c343c7759dfecdededbf501d80470e81
Author: Praneeth Balasubramanian <praneethb2002@gmail.com>
> mxser: take termios_rwsem in mxser_set_serial_info()
>
> mxser_set_serial_info() updates the termios without holding
> tty->termios_rwsem. It calls tty_encode_baud_rate() which writes c_ispeed
> and c_ospeed and rewrites the CBAUD bits of c_cflag. It also reads the
> termios in mxser_change_speed() and mxser_activate().
>
> A concurrent TCSETS or TCSETS2 on the same tty stores the whole termios
> under termios_rwsem in tty_set_termios(). The TIOCSSERIAL path takes no
> termios_rwsem. The two writers can interleave. The whole-struct store can
> land between the speed stores and leave c_cflag, c_ispeed and c_ospeed
> disagreeing with each other.
>
> Take termios_rwsem for write at the top of mxser_set_serial_info().
> Take it before port->mutex. serial_core takes termios_rwsem before
> port->mutex in uart_set_info_user() and both lock classes are global. The
> same order here avoids a lockdep inversion. Nothing inside the critical
> section takes termios_rwsem itself.
>
> This was found by an LLM-based audit that checks code against the rules
> stated in kernel comments.
>
> Signed-off-by: Praneeth Balasubramanian <praneethb2002@gmail.com>
[Severity: Low]
This fixes an unlocked tty_encode_baud_rate() call in
mxser_set_serial_info(). Should this include:
Fixes: 80ff8a805113 ("Char: mxser, add support for CP-114UL")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205063536.2519566-1-praneethb2002@gmail.com?part=4
prev parent reply other threads:[~2026-12-05 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 6:35 [PATCH 0/4] tty: fix a stack overread and missing locking in serial drivers Praneeth Balasubramanian
2026-12-05 6:35 ` [PATCH 4/4] mxser: take termios_rwsem in mxser_set_serial_info() Praneeth Balasubramanian
2026-12-05 6:56 ` 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-251164@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=linux-serial@vger.kernel.org \
--cc=praneethb2002@gmail.com \
--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