<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/tty, branch v4.19.112</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-03-11T13:15:03+00:00</updated>
<entry>
<title>vt: selection, push sel_lock up</title>
<updated>2020-03-11T13:15:03+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2020-02-28T11:54:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b4492f1e7456bd162714c0ec2815c2749d930844'/>
<id>urn:sha1:b4492f1e7456bd162714c0ec2815c2749d930844</id>
<content type='text'>
commit e8c75a30a23c6ba63f4ef6895cbf41fd42f21aa2 upstream.

sel_lock cannot nest in the console lock. Thanks to syzkaller, the
kernel states firmly:

&gt; WARNING: possible circular locking dependency detected
&gt; 5.6.0-rc3-syzkaller #0 Not tainted
&gt; ------------------------------------------------------
&gt; syz-executor.4/20336 is trying to acquire lock:
&gt; ffff8880a2e952a0 (&amp;tty-&gt;termios_rwsem){++++}, at: tty_unthrottle+0x22/0x100 drivers/tty/tty_ioctl.c:136
&gt;
&gt; but task is already holding lock:
&gt; ffffffff89462e70 (sel_lock){+.+.}, at: paste_selection+0x118/0x470 drivers/tty/vt/selection.c:374
&gt;
&gt; which lock already depends on the new lock.
&gt;
&gt; the existing dependency chain (in reverse order) is:
&gt;
&gt; -&gt; #2 (sel_lock){+.+.}:
&gt;        mutex_lock_nested+0x1b/0x30 kernel/locking/mutex.c:1118
&gt;        set_selection_kernel+0x3b8/0x18a0 drivers/tty/vt/selection.c:217
&gt;        set_selection_user+0x63/0x80 drivers/tty/vt/selection.c:181
&gt;        tioclinux+0x103/0x530 drivers/tty/vt/vt.c:3050
&gt;        vt_ioctl+0x3f1/0x3a30 drivers/tty/vt/vt_ioctl.c:364

This is ioctl(TIOCL_SETSEL).
Locks held on the path: console_lock -&gt; sel_lock

&gt; -&gt; #1 (console_lock){+.+.}:
&gt;        console_lock+0x46/0x70 kernel/printk/printk.c:2289
&gt;        con_flush_chars+0x50/0x650 drivers/tty/vt/vt.c:3223
&gt;        n_tty_write+0xeae/0x1200 drivers/tty/n_tty.c:2350
&gt;        do_tty_write drivers/tty/tty_io.c:962 [inline]
&gt;        tty_write+0x5a1/0x950 drivers/tty/tty_io.c:1046

This is write().
Locks held on the path: termios_rwsem -&gt; console_lock

&gt; -&gt; #0 (&amp;tty-&gt;termios_rwsem){++++}:
&gt;        down_write+0x57/0x140 kernel/locking/rwsem.c:1534
&gt;        tty_unthrottle+0x22/0x100 drivers/tty/tty_ioctl.c:136
&gt;        mkiss_receive_buf+0x12aa/0x1340 drivers/net/hamradio/mkiss.c:902
&gt;        tty_ldisc_receive_buf+0x12f/0x170 drivers/tty/tty_buffer.c:465
&gt;        paste_selection+0x346/0x470 drivers/tty/vt/selection.c:389
&gt;        tioclinux+0x121/0x530 drivers/tty/vt/vt.c:3055
&gt;        vt_ioctl+0x3f1/0x3a30 drivers/tty/vt/vt_ioctl.c:364

This is ioctl(TIOCL_PASTESEL).
Locks held on the path: sel_lock -&gt; termios_rwsem

&gt; other info that might help us debug this:
&gt;
&gt; Chain exists of:
&gt;   &amp;tty-&gt;termios_rwsem --&gt; console_lock --&gt; sel_lock

Clearly. From the above, we have:
 console_lock -&gt; sel_lock
 sel_lock -&gt; termios_rwsem
 termios_rwsem -&gt; console_lock

Fix this by reversing the console_lock -&gt; sel_lock dependency in
ioctl(TIOCL_SETSEL). First, lock sel_lock, then console_lock.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: syzbot+26183d9746e62da329b8@syzkaller.appspotmail.com
Fixes: 07e6124a1a46 ("vt: selection, close sel_buffer race")
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200228115406.5735-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>vt: selection, push console lock down</title>
<updated>2020-03-11T13:15:03+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2020-02-28T11:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efaef8463e1a9c20aa19c3de2b2d19f885e0315e'/>
<id>urn:sha1:efaef8463e1a9c20aa19c3de2b2d19f885e0315e</id>
<content type='text'>
commit 4b70dd57a15d2f4685ac6e38056bad93e81e982f upstream.

We need to nest the console lock in sel_lock, so we have to push it down
a bit. Fortunately, the callers of set_selection_* just lock the console
lock around the function call. So moving it down is easy.

In the next patch, we switch the order.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Fixes: 07e6124a1a46 ("vt: selection, close sel_buffer race")
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200228115406.5735-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>vt: selection, close sel_buffer race</title>
<updated>2020-03-11T13:15:02+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2020-02-10T08:11:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=31559b59040fc0e6ad363642112d4eb03ad4ebb7'/>
<id>urn:sha1:31559b59040fc0e6ad363642112d4eb03ad4ebb7</id>
<content type='text'>
commit 07e6124a1a46b4b5a9b3cacc0c306b50da87abf5 upstream.

syzkaller reported this UAF:
BUG: KASAN: use-after-free in n_tty_receive_buf_common+0x2481/0x2940 drivers/tty/n_tty.c:1741
Read of size 1 at addr ffff8880089e40e9 by task syz-executor.1/13184

CPU: 0 PID: 13184 Comm: syz-executor.1 Not tainted 5.4.7 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
...
 kasan_report+0xe/0x20 mm/kasan/common.c:634
 n_tty_receive_buf_common+0x2481/0x2940 drivers/tty/n_tty.c:1741
 tty_ldisc_receive_buf+0xac/0x190 drivers/tty/tty_buffer.c:461
 paste_selection+0x297/0x400 drivers/tty/vt/selection.c:372
 tioclinux+0x20d/0x4e0 drivers/tty/vt/vt.c:3044
 vt_ioctl+0x1bcf/0x28d0 drivers/tty/vt/vt_ioctl.c:364
 tty_ioctl+0x525/0x15a0 drivers/tty/tty_io.c:2657
 vfs_ioctl fs/ioctl.c:47 [inline]

It is due to a race between parallel paste_selection (TIOCL_PASTESEL)
and set_selection_user (TIOCL_SETSEL) invocations. One uses sel_buffer,
while the other frees it and reallocates a new one for another
selection. Add a mutex to close this race.

The mutex takes care properly of sel_buffer and sel_buffer_lth only. The
other selection global variables (like sel_start, sel_end, and sel_cons)
are protected only in set_selection_user. The other functions need quite
some more work to close the races of the variables there. This is going
to happen later.

This likely fixes (I am unsure as there is no reproducer provided) bug
206361 too. It was marked as CVE-2020-8648.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: syzbot+59997e8d5cbdc486e6f6@syzkaller.appspotmail.com
References: https://bugzilla.kernel.org/show_bug.cgi?id=206361
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200210081131.23572-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: 8250_exar: add support for ACCES cards</title>
<updated>2020-03-11T13:15:02+00:00</updated>
<author>
<name>Jay Dolan</name>
<email>jay.dolan@accesio.com</email>
</author>
<published>2020-03-05T14:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=232bae49a85c87c9a55411761586a99eac90bfa6'/>
<id>urn:sha1:232bae49a85c87c9a55411761586a99eac90bfa6</id>
<content type='text'>
commit 10c5ccc3c6d32f3d7d6c07de1d3f0f4b52f3e3ab upstream.

Add ACCES VIDs and PIDs that use the Exar chips

Signed-off-by: Jay Dolan &lt;jay.dolan@accesio.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200305140504.22237-1-jay.dolan@accesio.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty:serial:mvebu-uart:fix a wrong return</title>
<updated>2020-03-11T13:15:01+00:00</updated>
<author>
<name>tangbin</name>
<email>tangbin@cmss.chinamobile.com</email>
</author>
<published>2020-03-05T01:38:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c1f86b2e5ec2c74f7165caca6e9c2e7c3714dfd'/>
<id>urn:sha1:6c1f86b2e5ec2c74f7165caca6e9c2e7c3714dfd</id>
<content type='text'>
commit 4a3e208474204e879d22a310b244cb2f39e5b1f8 upstream.

in this place, the function should return a
negative value and the PTR_ERR already returns
a negative,so return -PTR_ERR() is wrong.

Signed-off-by: tangbin &lt;tangbin@cmss.chinamobile.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Acked-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20200305013823.20976-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE</title>
<updated>2020-03-11T13:14:48+00:00</updated>
<author>
<name>Daniel Golle</name>
<email>daniel@makrotopia.org</email>
</author>
<published>2020-02-07T09:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce69cc4e350bd90d8bbf1c0b3d111407654e0b24'/>
<id>urn:sha1:ce69cc4e350bd90d8bbf1c0b3d111407654e0b24</id>
<content type='text'>
[ Upstream commit 87c5cbf71ecbb9e289d60a2df22eb686c70bf196 ]

On AR934x this UART is usually not initialized by the bootloader
as it is only used as a secondary serial port while the primary
UART is a newly introduced NS16550-compatible.
In order to make use of the ar933x-uart on AR934x without RTS/CTS
hardware flow control, one needs to set the
UART_CS_{RX,TX}_READY_ORIDE bits as other than on AR933x where this
UART is used as primary/console, the bootloader on AR934x typically
doesn't set those bits.
Setting them explicitely on AR933x should not do any harm, so just
set them unconditionally.

Tested-by: Chuanhong Guo &lt;gch981213@gmail.com&gt;
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Link: https://lore.kernel.org/r/20200207095335.GA179836@makrotopia.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sysrq: Remove duplicated sysrq message</title>
<updated>2020-03-05T15:42:15+00:00</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2019-01-11T16:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7bc2d23c3ab92645a01dd7f8b72feb0049b664b3'/>
<id>urn:sha1:7bc2d23c3ab92645a01dd7f8b72feb0049b664b3</id>
<content type='text'>
commit c3fee60908db4a8594f2e4a2131998384b8fa006 upstream.

The commit 97f5f0cd8cd0a0544 ("Input: implement SysRq as a separate input
handler") added pr_fmt() definition. It caused a duplicated message
prefix in the sysrq header messages, for example:

[  177.053931] sysrq: SysRq : Show backtrace of all active CPUs
[  742.864776] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c)

Fixes: 97f5f0cd8cd0a05 ("Input: implement SysRq as a separate input handler")
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Tommi Rantala  &lt;tommi.t.rantala@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sysrq: Restore original console_loglevel when sysrq disabled</title>
<updated>2020-03-05T15:42:15+00:00</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2019-01-11T12:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a85451011c3203c00930860d453c18e57f9f4c52'/>
<id>urn:sha1:a85451011c3203c00930860d453c18e57f9f4c52</id>
<content type='text'>
commit 075e1a0c50f59ea210561d0d0fedbd945615df78 upstream.

The sysrq header line is printed with an increased loglevel
to provide users some positive feedback.

The original loglevel is not restored when the sysrq operation
is disabled. This bug was introduced in 2.6.12 (pre-git-history)
by the commit ("Allow admin to enable only some of the Magic-Sysrq
functions").

Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Reviewed-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Cc: Tommi Rantala &lt;tommi.t.rantala@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Fix RX cancel command failure</title>
<updated>2020-02-28T15:38:55+00:00</updated>
<author>
<name>satya priya</name>
<email>skakit@codeaurora.org</email>
</author>
<published>2020-02-11T10:13:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56ad5b4b7405ec08ef3f2b33cd59f5b3bca6577c'/>
<id>urn:sha1:56ad5b4b7405ec08ef3f2b33cd59f5b3bca6577c</id>
<content type='text'>
[ Upstream commit 679aac5ead2f18d223554a52b543e1195e181811 ]

RX cancel command fails when BT is switched on and off multiple times.

To handle this, poll for the cancel bit in SE_GENI_S_IRQ_STATUS register
instead of SE_GENI_S_CMD_CTRL_REG.

As per the HPG update, handle the RX last bit after cancel command
and flush out the RX FIFO buffer.

Signed-off-by: satya priya &lt;skakit@codeaurora.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/1581415982-8793-1-git-send-email-skakit@codeaurora.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: qcom_geni_serial: Remove xfer_mode variable</title>
<updated>2020-02-28T15:38:54+00:00</updated>
<author>
<name>Ryan Case</name>
<email>ryandcase@chromium.org</email>
</author>
<published>2019-01-08T01:58:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6ebad85883d99b15ef20f522d46de5f88e64848'/>
<id>urn:sha1:e6ebad85883d99b15ef20f522d46de5f88e64848</id>
<content type='text'>
[ Upstream commit bdc05a8a3f822ca0662464055f902faf760da6be ]

The driver only supports FIFO mode so setting and checking this variable
is unnecessary. If DMA support is ever added then such checks can be
introduced.

Signed-off-by: Ryan Case &lt;ryandcase@chromium.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
