From: Jiayi Zhang <zhangjiayi1014@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Osama Abdelkader" <osama.abdelkader@gmail.com>,
"Pimyn Girgis" <pimyn@google.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+0479f67e520e4910d370@syzkaller.appspotmail.com,
syzbot+2430ce6b487fe0119d03@syzkaller.appspotmail.com,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] tty: n_tty: hold termios_rwsem in n_tty_lookahead_flow_ctrl()
Date: Sat, 5 Dec 2026 08:25:57 +0000 [thread overview]
Message-ID: <20261205082557.3074299-1-zhangjiayi1014@gmail.com> (raw)
In-Reply-To: <2026120429-sharper-approval-9326@gregkh>
On Fri, Dec 04, 2026, Greg Kroah-Hartman wrote:
> What changed to cause this to be needed now?
Nothing changed. n_tty_lookahead_flow_ctrl() has read the termios and
updated ldata->lookahead_count without termios_rwsem since the
lookahead was added in 6bb6fa6908eb ("tty: Implement lookahead to
process XON/XOFF timely"), in v6.0. syzbot's first reports of the two
races are from August and September 2022. The reports in the Closes:
tags are the 5th and the 10th with these titles. syzbot closed each
earlier one as obsolete after it had not recurred for a while.
> And why the "private" syzbot reports?
Pimyn has explained how the moderation list works. The dashboard
pages show that syzbot's AI triage marked both races as benign, so
neither report was forwarded to the lists. I found them while going
through open syzbot reports on the dashboard.
For the hangup in the second report the benign rating is right:
tty_ldisc_hangup() closes the ldisc after the flush, and n_tty_close()
frees ldata. The other cases need backed-up input, because only then
does the lookahead run, and a concurrent TCIFLUSH or TCSETS. After
TCIFLUSH, a lost reset makes the receive path drop later START/STOP
characters without stopping or starting the tty. A TCSETS that clears
IXON during a lookahead pass can leave the tty stopped. I found these
by reading the code and have not seen them happen.
Sorry, I missed that Osama Abdelkader (Cc'd) sent the same change in
February for an earlier report of the flush race:
https://lore.kernel.org/all/20260211210838.45127-1-osama.abdelkader@gmail.com/
You replied then that it felt wrong and asked for a lot of testing
and validation. My testing was the syzbot reproducer with KCSAN
(described below the --- of my patch) and the same reproducer for
9 minutes on 5 VMs with lockdep enabled, which reported nothing.
Since Osama's patch came first, please drop mine. If you want the
change, please take his.
Thanks,
Jiayi
prev parent reply other threads:[~2026-12-05 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 18:08 Jiayi Zhang
2026-12-04 8:47 ` Greg Kroah-Hartman
2026-12-04 10:36 ` Pimyn Girgis
2026-12-05 8:25 ` Jiayi Zhang [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=20261205082557.3074299-1-zhangjiayi1014@gmail.com \
--to=zhangjiayi1014@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=osama.abdelkader@gmail.com \
--cc=pimyn@google.com \
--cc=syzbot+0479f67e520e4910d370@syzkaller.appspotmail.com \
--cc=syzbot+2430ce6b487fe0119d03@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®